How to add a model in standalone Mechanical ?

Erik Kostson
Erik Kostson Member, Moderator, Employee Posts: 285
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited January 12 in Structures

We want to add via script say a cdb file to a standalone mechanical (Mechanical 2024 R2)?

Best Answer

  • Erik Kostson
    Erik Kostson Member, Moderator, Employee Posts: 285
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited January 12 Answer ✓

    Below is an example on how it can be done via mechanical scripting in a new Mechanical standalone session (with the Start a New Mechanical Project option to get started).

    mimp=Model.GeometryImportGroup.AddModelImport()
    mimp.ModelImportSourceFilePath='D:\\DATA\\filecdb.cdb'
    mimp.Import()
    
    

    And if needed in/for 2D analysis add the below before importing (mimp.Import()):

    mimp.AnalysisTypeDimensionSetting=AnalysisTypeDimensionEnum.TwoD
    
    

    To control/define the imported cdb file units before importing (say for NMM consistent units):

    mimp.UnitSystemTypeForImport=ModelImportUnitSystemType.UnitSystemConsistentNMM

This discussion has been closed.