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

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

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

enter image description here

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    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()