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

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
edited June 2023 in Structures

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

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

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

    import os
    folder = r"D:\Data_CMS"
    path1 = os.path.join(folder,'NastranKMs3.dmig')
    path2 = os.path.join(folder,'NastranMs3.dmig')
    ExtAPI.DataModel.Project.CombineTextFiles(path1, path2)
     
    condensedGeom = ExtAPI.DataModel.Project.Model.CondensedGeometry
    importCondensedGeom = condensedGeom.AddImportedCondensedPart()
    importCondensedGeom.ImportFileFormat=CondensedPartFileFormat.SuperElement_MATRIX
    importCondensedGeom.CondensedPartFileName = path1
    condensedGeom.GenerateCondensedParts()
    
  • Alan_H_Escamilla
    Alan_H_Escamilla Member Posts: 1
    First Comment
    **

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

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First 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.

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 56
    Second Anniversary 10 Comments 5 Likes Name Dropper
    ✭✭✭✭

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

  • Gabriel Messager
    Gabriel Messager Member, Employee Posts: 56
    Second Anniversary 10 Comments 5 Likes Name Dropper
    ✭✭✭✭

    importCondensedGeom.CreateRemotePoints([1])