Synchro Script - PARENT.PARENT.PARENT.PARENT...

I am writing a script to generate ResourceGroups based on a UserField that is dependent on the name of the imported .ifc file.

Example:

There are 9 child tasks underneath the parent task of the construction.ifc file. The condition of the script:

RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....

The installation .ifc model only has 6 child tasks underneath the parent task. The condition of this script:

RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "installation") ....

I don't want to edit each script based on the number of child tasks as this varies on the type of the model.
I wrote the following script which searches in the name of all 9 parent tasks in case there are fewer child tasks.

RESOURCE (PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....
RESOURCE (PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.PARENT.NAME <> "construction") ....

Is there a way to easily search in all available parents?

Best regards,
Stephan Klotz

Parents Reply Children
No Data