General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Importing a Ansys model into PyMechanical

    • cardiac.scripter
      Subscriber

      Hi, 

      I have just started with PyMechanical. However, I am struggling to find documentation on the library. 

      I have an ansys model already meshed as an .inp file. How can I import that directly into PyMechanical?

      Thanks in advance, 

      Ben

    • cardiac.scripter
      Subscriber

      Not to worry. 

      I have found the documentation here: import_model — PyACP


    • Erik Kostson
      Ansys Employee

       

       

      Hi

      This post shows how to import the cdb file into a standalone mechanical or via pymechanical (you need to save a .cdb file not a ds.dat ).

      https://discuss.ansys.com/discussion/4431/how-to-add-a-model-in-standalone-mechanical

      All the best

      Erik

      PS : this link shows how to save a cdb file :

      https://innovationspace.ansys.com/knowledge/forums/topic/how-to-export-cdb-from-mechanical-without-solving-the-case/

       

       

       

       

      • cardiac.scripter
        Subscriber

        Hi Erik,

        I also have the model in .cdb format so thats fine.

        The problem is the link I sent above is for pyACP. Do you know how I can do it for pyMechanical?

        Cheers

        • Erik Kostson
          Ansys Employee

           

          Hi

           

          See the below link:

          https://discuss.ansys.com/discussion/4431/how-to-add-a-model-in-standalone-mechanical

           

          Any questions on this, please post it in the above forum (dedicated to scripting).

          Erik

           

    • cardiac.scripter
      Subscriber

      Thank you Erik!

      Here it is for anyone else:

      # Import the model
      mimp=Model.GeometryImportGroup.AddModelImport()
      mimp.ModelImportSourceFilePath=input_file
      mimp.Import()
      • Erik Kostson
        Ansys Employee

        That is great - glad it helped.

        Thank you

        Erik

Viewing 3 reply threads
  • The topic ‘Importing a Ansys model into PyMechanical’ is closed to new replies.