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

aalperakis
aalperakis Member Posts: 6
Name Dropper First Comment First Anniversary
**
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: 859
    500 Comments Photogenic Name Dropper 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