This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help for writing a Synchro script

Hi everyone, I hope you're all doing good. I need help with the Synchro script, please refer to the context below

On one of the Synchro project I'm working on, I've created a custom task UF for each task named ''Task Name Augmentor". I assigned 3D resources to tasks that represent concrete pouring, now I want to assign the same resources for the relevant formwork & rebar activities.  For example, for 1F to 2F column, I've assigned 3D resources to the concrete pouring task, now under the same WBS and for formwork & rebar tasks I want to assign the same resources as concrete pouring. For all the three tasks Task UF property remains the same.

For the above context, I want to write a script so that Synchro performs the operation on the selected tasks, by searching for tasks that have the same task UF i.e''Task Name Augmentor". Now between these tasks, one task (concrete pouring) would have resource assignments, Synchro should select these resources and assign to the other two tasks (formwork & rebar) using the appearance profile "Ïnstall" which do not have any 3D resource assignments.

I know that script would be something like this: TASK(SELECTED) (Condition=?, I want you to help me with this) SET_PROPERTY(PROPERTY("APPEARANCE PROFILE'),ALL_USE_PROFILE(NAME==INSTALL))

Thanks in advance.

Parents
  • Hi, 

    i like your question!

    I think Jacqueline has answered the second part of your purpose but the first one is really interesting. 

    You can use VAR in this case. VAR is used in some command with second object argument. There are two possibilities for assigning the resource assignments of the first task to the other two tasks. :

    1. Select the appropriate resources and use this script:

    RESOURCE(SELECTED) ASSIGN_OBJECT(VAR TASK(UFV("Task Name Augmentor")=="xxx"))
    TASK(UFV("Task Name Augmentor")=="xxx").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "Install" ))

    2. Select the appropriate tasks and use this script:

    TASK(SELECTED) ASSIGN_OBJECT(VAR TASK(UFV("Task Name Augmentor")=="xxx").ASSIGNMENT) 
    TASK(UFV("Task Name Augmentor")=="xxx").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "Install" ))

    I'm quite sure that the first possibility works well. For the second possibility, i have a doubt because i'm not sure if the VAR command can apply to multiple object like TASK.ASSIGNMENT

    Hope that is useful for you!

    Best Regards,

    QSN

  • Hi QSN,

    I have similar scenario, where resource are assigned to concrete task. I want to assign the same resources to Formwork and Rebar using script.

  • Dear Zajid

    TASK(NAME >= "Concrete").RESOURCE.LEAF ASSIGN_OBJECT(VAR TASK(PARENT.USER_ID ==$0.PARENT.USER_ID AND NAME >= "Rebar" ))

    Hope this one is useful for you.

    Sincerely.

    Spencer

  • Script can be helpful if you apply for the whole project where these tasks "Rebar", "Formwork" and "Concrete" are repetitive in the different WBS levels. You can run the one discribed by Zepeng 

    TASK(NAME == "Concrete").RESOURCE.LEAF ASSIGN_OBJECT(VAR TASK(PARENT.USER_ID ==$0.PARENT.USER_ID AND NAME == "Rebar" ))

    TASK(NAME == "Concrete").RESOURCE.LEAF ASSIGN_OBJECT(VAR TASK(PARENT.USER_ID ==$0.PARENT.USER_ID AND NAME == "Formwork" ))

    And then run this one for the appearance profile (you need to create the appropriated apprearance profile, for example "rebar" and "formwork" )

    TASK(NAME=="Rebar").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "rebar" ))

    TASK(NAME=="Formwork").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "formwork" ))

    Best regards,

    QSN

Reply
  • Script can be helpful if you apply for the whole project where these tasks "Rebar", "Formwork" and "Concrete" are repetitive in the different WBS levels. You can run the one discribed by Zepeng 

    TASK(NAME == "Concrete").RESOURCE.LEAF ASSIGN_OBJECT(VAR TASK(PARENT.USER_ID ==$0.PARENT.USER_ID AND NAME == "Rebar" ))

    TASK(NAME == "Concrete").RESOURCE.LEAF ASSIGN_OBJECT(VAR TASK(PARENT.USER_ID ==$0.PARENT.USER_ID AND NAME == "Formwork" ))

    And then run this one for the appearance profile (you need to create the appropriated apprearance profile, for example "rebar" and "formwork" )

    TASK(NAME=="Rebar").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "rebar" ))

    TASK(NAME=="Formwork").ASSIGNMENT SET_PROPERTY( PROPERTY("Appearance Profile"), ALL_USE_PROFILE( NAME == "formwork" ))

    Best regards,

    QSN

Children
No Data