Enter error message or question

Varun_Parekh
Member Posts: 4
**
Scripting help
I am reposting this because I was not able to edit the previous question.
I have made a geometry of 3DIC in Pyansys aedt using Icepak.
I would like to import this geometry into pymechanical to perform thermal structural analysis.
Is there a way to do this?
I tried to do save as .step file and import it in the workbench through the following script:
SetScriptVersion(Version="24.1.144") \n template1 = GetTemplate(TemplateName="Geometry") \n system1 = template1.CreateSystem() \n geometry1 = system1.GetContainer(ComponentName="Geometry")\n geometry1.SetFile(FilePath=GetAbsoluteUserPathName("<path_to_file>/PackageWithBumps.step")) \n projectTemplate1 = GetProjectTemplate(Name="Thermal-Stress") \n projectTemplate1.CreateProject() \n system2 = GetSystem(Name="Steady-State Thermal (ANSYS)") \n geometryComponent1 = system2.GetComponent(Name="Geometry") \n geometryComponent2 = system1.GetComponent(Name="Geometry") \n geometryComponent1.ReplaceWithShare( TargetSystem=system2, ComponentToShare=geometryComponent2, SourceSystem=system1) \n modelComponent1 = system2.GetComponent(Name="Model") \n modelComponent1.Refresh() \n model1 = system2.GetContainer(ComponentName="Model") \n
I am also able to import it using Mechanical GUI scripting as follows:
geometry_path = r"<path_to_file>/PackageWithBumps.step" \n geometry_import = Model.GeometryImportGroup.AddGeometryImport()\n geometry_import.Import(geometry_path)\n
Can I get some suggestions on how I can run this without GUI only through code?
0