What is the best way to deal with elements in groups?

Hello,
I regularly meet this issue that I want to edit let’s say 100 elements but some are in groups. Revit wants to ungroup the group to make changes.
So let’s put a simple example here, I have 10 lines, 2x3 is in a group (group has 2 instance). I need to rotate each line 5 degree. If there is no group it is a rather simple task, rotate the geometry then Element.SetLocation. But now that I have a group with two instances it is not that simple.

Obviously the above example is oversimplified, here is a screenshot what I’m dealing with, essentially the same problem.

Any suggestion welcomed.

Filter out grouped elements, deal with them manually. I have a node in Crumple to check if elements are in a group under Revit > Elements.

I was afraid of this answer. What you see on the screenshot is 4000 area boundary lines, probably 3000 grouped. So majority is “manual” which is what I want to avoid. Of course, dynamo is not running in group edit mode.

Dynamo cannot run in group edit mode, inbuilt limitation. I’m currently experimenting with developing an approach involving group duplication and editability of single instance groups in Python but it’s still under development - has a lot of quirks.

If i solve it I’ll likely make a video about it on my YT channel down the line.

Worth putting some votes into an official idea station posting, on the Revit roadmap, or starting a topic around the limitations of groups in the official Revit API forum. Otherwise we’ll keep having to deal with work-arounds.

2 Likes

Hey,

There is an idea started here…

You can edit a group element outside of group edit mode if it is in the only placed group.

So if you:

Duplicate the group to make a new ‘temporary’ one
Swap all the other group instances to the new group type
Edit the element in the one remaining
Swap the others back
Delete the ‘temporary’ group.

Pretty painful, but doable.

Hope that helps,

Mark

Be sure to keep the group origin in mind. People modify this all the time and there is no way for you to set it with the API.

We have some internal “APIs” for group modification for clients that modify the origin to be truly centered.

Example of why this is important:

A simple group action in Python or similar could be:

  • Place fresh instance of group
  • ungroup
  • Remove item
  • Regroup remaining items
  • Change all other instances to your new one
  • Instances move because origin is now different.
4 Likes

We had a pretty cool live discussion with TestFit on model groups a while back here:https://www.youtube.com/live/FiVO2U7DxKw?si=XR2VYOFnjQkopXKZ&t=1656

Specifically this part:

4 Likes

And for those interested, I have a node in Rhythm that allows group creation with a defined origin using the hack I talked about on the live stream above.

4 Likes

Thanks for the tips and resources, going to be very helpful! It’s definitely a dark art… and a nice hack - recall seeing it via the TF thing also.