How to get the connected parent system name from project page, using automation scripting.

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭

How to get the connected parent system name from project page, using automation scripting.

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    systems = GetAllSystems()
    for system in systems:
        if system.DisplayText == 'Static Structural':
        #index=0; specify the correct index
            component1 = system.Components[0]
            coordinate = ACT.InitializeAndGenerateTaskCoordinates(component1)
            parent = ExtAPI.DataModel.GetTaskByCoordinate(coordinate).RealTask.TaskGroup.Caption
            print(parent)
        #If parent system is connected to setup, use below changes'
        #ExtAPI.DataModel.GetTaskByCoordinate(coordinate).SourceTasks[1].TaskGroup.Caption