Change objects in modelgroup

Im looking for help regarding dynamo script to make it possible to change objects in model groups. In this case Im running a function that cuts out the floor where walls are standing. All is working fine except the modelgroup keeps/create one extra floor connected “visible” by Restore All Excluded.

As i know, dynamo cant acces the comand Edit Group and for that reason find it difficult to make changes i model groups.

Is there anyone here whos bean able to change objects in model groups with dynamo script?
( I know it works for parameters. ) (Its not a solution to create new group types.)

Kind regards, Victor

The only solution is to create new group types and swap them in for the old group types, or to not use groups.

dont think its possible without create a new group will you add or remove ?

My aim is either to add or remove, just to change existing floor in the group.

Editing isn’t an option.

What if Dynamo can identifie the object referred to as Restore All Excluded and remove them from the equation?

we cant add or remove so what you can do ungroup the group add or remove members, group again with the same group name…but the group id will change…here i add and keep the group name but as you see i basic create a new group, but with same name

group.dyn (11.9 KB)

I gues that dosnt work if you have more then 1 example of your group placed in your model.

you can try it i have shared the dyn…with 2 python for cpython and pyhonnet 3

Hi yes, the flow is something like..

  1. Get an instance of your group type

  2. Copy the group type

  3. Set the instance to ‘group type copy’

    There is only 1 instance of ‘group type copy’, so you are allowed to change the elements inside the group without entering ‘group edit mode’.

  4. Make the edits to ‘group type copy’

  5. Set all instances of ‘original group type’ to ‘group type copy’

  6. Delete ‘original group type’.

  7. Rename ‘group type copy’ to ‘original group type’ name.

Hope that helps,

Mark

I was going a bit more in depth further than this.

  1. Identify a group instance
  2. Get the group type
  3. Change the group type name
  4. Ungroup the group instance
  5. Modify the floor
  6. Make a new group type from the ungrouped elements, using the name of the previous group type
  7. Get all instances of the previous group type
  8. Swap the instances type for the new type
  9. Delete the old group type

The issue here and why I don’t like this method is that EVERY item in every group is now ‘new’, so when doing QA review of model updates you see everything as needing review as if it were new. You also run the risk of not maintaining any ‘exclude from group’ changes, as well as potential annotation elements (dimensions in particular) becoming disassociated.

My personal preference as a result is to just not use groups.

I also thought it was possibel to make changes when its only one instace of your model group. I will try another change then cutting the floor and see what happen if i just change the wall hight.

If there is only one instance I would ungroup it and leave it that way. Too many API based inconsistencies to make grouping of single instances worthwhile.