Switching Groups in Revit

I am looking to setup something that would allow me to choose a group with all of its attached groups that is currently in the project and replace it with a different group with all of its attached groups in the same location.
Essentially want to select a group and swap it for a different group that exists in the project without the location of the groups changing.

If I’m understanding your intent, you should be able to just change the group type.

If I’m missing something then you might need to actually replace the instance. In that case, the simplest thing to do is just get the existing instance’s location, delete the group, then place a new instance at that same location. If the groups have same relative origin then you’re all set. If not, you’ll need to account for that difference.

Do you also need to replace (maintain) all the parameter values within the existing groups? If so, you need to also map all the associated parameters and values to the new group instance’s parameters and values. If not, you can just replace the groups.

It is a bit of a weird situation. I am aware of being able to switch the groups within revit and have been doing it. The issue is that there are attached groups in other views that are becoming ungrouped so I am looking for a way to swap everything all at once. What you suggested with deleting the group and placing a new instance at the same location should work. I am just very new to using Dynamo so not sure what nodes would be needed to delete the group and place in a new one. I have been able to get dynamo to filter to specifc groups so far but that is about it.

There are a couple other threads that deal with managing groups that may be helpful, but I think you’ll need to find a custom package for placing. Orchid has a GroupType.Place node and some other nodes that may be helpful. The ootb nodes Element.Delete and Group.AttachedDetailGroup should also help get you started.

I have it to a point now where it is deleting an existing group and replacing it with a different group and recognizing the attached groups of the new group that was just placed into the project. I am now struggling to get the attached groups to be placed into the model because the attached groups dont have a location according the the “Group.Location” node

Make sure you’re dealing with the group instance again. You may have to go through the API in this case. Nodes dealing with groups are fairly limited.

Yeah think thats where I am going to have to stop. I have no clue currently how to use the API since I have only been using dynamo this week but I do know there are the ShowAttachedDetailGroups in the API and will probably work towards that. This is all I currently have for the Attached groups in my project so I hope there is something that can be worked with