Delete Element in Model Group

Hi,

I know the topic of editing group has been discussed on some threads, but I’m struggling to find the solution for this.

I need to delete elements inside a group and hope the deletion is carried through to all instances on that group.

Below is dummy file that use to workout the script and you can see the deletion only occur in one instance of the group, and behave such that the wall that is deleted is excluded from that instance of the group.

Anyone has a solution for this group editing yet?

The real project I’m working on is a major apartment development where each apartment type layout is a model group, and there are tens of groups with hundreds instances of them. Finding a solution of the above will be very2 powerful for us.

Thanks in advance.

When you use delete in the manner you are in your example, this is just doing the “exclude in group” option unfortunately.

1 Like

Hi John,
Thanks for your response, can you think of a work around?

Next thing I had in mind was ungrouping, edit and group it back. But the problem with ungrouping is it’ll only ungroup one instance also, rather than “edit group” and apply to all the group instances.

Yeah. That’s what I was thinking too. Let me do some trials. Hopefully someone else can maybe weigh in too.

Also, here is more info

I am looking for the same function in the revit API that I can exclude elements from the group. I could not find Element.Delete in the revit docs. How can I exclude elements inside the revit group using the Revit API?

Delete nodes are now in Dynamo natively. But if you are in an older version, spring nodes has a delete node.

The workflow is like this:

Model Group > Get Group Elements > “Delete” the element (resulting in exclude)

Thanks !. I am looking for a solution in the Revit docs using c# not dynamo

Simply search for the word delete.

This is delete from the document. it is different. I am looking for deleting from the group itself. It is exactly what the Dynam Element.delete does. deleting an element from a group instance and not from the entire document

I assure you there is no different delete for groups in the API.


If you want to truly delete the element from the group (not exclude) that is not currently possible via the API.

The one I linked to is the correct method if you are looking to exclude elements from the group.

Yes. And when applied to an element in a group it does an exclude.

Here is a GIF showing how the delete works when you actually try it.
20230116-ExcludeFromGroups

Thnks, I have tried many options. it is the Document.Delete(ElementId) actually.