How can I create the figures renamed based on the parent object name

aalperakis Member Posts: 5
First Anniversary Name Dropper First Comment
edited June 2023 in Structures


I have code as below but it comes named Figure. How can I create it based on Object?

Geometry,Materials, Static Structural etc.

a = ExtAPI.DataModel.Project.Model.Children
for b in a:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 810
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    Hi @aalperakis , you need to reference the created figure:

    figure = b.AddFigure()

    and then simply rename it:

    figure.Name = b.Name