How to add materials from material library in Mechanical with ACT?

Ayush Kumar
Member, Moderator, Employee Posts: 481
✭✭✭✭
Best Answer
-
- cmd = """
- library1 = EngData.OpenLibrary(
- Name="Composite Materials",
- Source="Composite_Materials.xml")
- system1 = GetSystem(Name="SYS")
- engineeringData1 = system1.GetContainer(ComponentName="Engineering Data")
- matl1 = engineeringData1.ImportMaterial(
- Name="E-Glass",
- Source="Composite_Materials.xml")
- """
- ExtAPI.Application.ScriptByName('journaling').ExecuteCommand(cmd)
- ExtAPI.DataModel.Project.Model.RefreshMaterials()
0
Answers
-
Thank you for the response above.
I have been try to use your code above in my script but it doesn't seem to have any effect.
The material doesn't show even when I ran the code in Ansys Mechanical GUI.
Could it be that the code is outdated as a result of a software update?
Thank you in advance
0 -
@Collins I tested today with 2024R1 and it seems work perfectly fine. Which version are you testing with?
0 -
0