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

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

Hello,

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:
    b.AddFigure()

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 ✓
    Options

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

    figure = b.AddFigure()

    and then simply rename it:

    figure.Name = b.Name