Superelement - combine .dmig files and create /import condensed part

Member, Moderator, Employee Posts: 873
100 Answers 500 Comments 250 Likes Second Anniversary
✭✭✭✭
edited June 2023 in Structures

Using scripting, how can I combine .dmig files and use the combined file to create a condensed part?

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Member, Moderator, Employee Posts: 873
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭

    The below code can be used. Note that CombineTextFiles() method appends the second file to the first file.

    1. import os
    2. folder = r"D:\Data_CMS"
    3. path1 = os.path.join(folder,'NastranKMs3.dmig')
    4. path2 = os.path.join(folder,'NastranMs3.dmig')
    5. ExtAPI.DataModel.Project.CombineTextFiles(path1, path2)
    6.  
    7. condensedGeom = ExtAPI.DataModel.Project.Model.CondensedGeometry
    8. importCondensedGeom = condensedGeom.AddImportedCondensedPart()
    9. importCondensedGeom.ImportFileFormat=CondensedPartFileFormat.SuperElement_MATRIX
    10. importCondensedGeom.CondensedPartFileName = path1
    11. condensedGeom.GenerateCondensedParts()
  • Member Posts: 1
    First Comment
    **

    Does this work if my dmig files are .asm and .pch?

  • Member, Moderator, Employee Posts: 873
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭

    @Alan_H_Escamilla I'm not sure what these .asm and .pch format stand for. What we are doing here is basically appending a text file to another text file. If you files are text format I think this should work. The best way to know is for you to try it out. If it doesn't work you can also try to modify the extension of your files to .dmig.

  • Member, Employee Posts: 59
    5 Answers Second Anniversary 10 Comments 5 Likes
    ✭✭✭✭

    @Pernelle Marone-Hitz Do you know how to promote Remote Points coming from an ICP with scripting?

  • Member, Employee Posts: 59
    5 Answers Second Anniversary 10 Comments 5 Likes
    ✭✭✭✭

    importCondensedGeom.CreateRemotePoints([1])

Welcome!

It looks like you're new here. Sign in or register to get started.