
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been working on a plugin with a feature to modify an element in a group based on the guide from the Building Coder (http://thebuildingcoder.typepad.com/blog/2010/08/editing-elements-inside-groups.html). It gets some data from the group, explodes the group, makes the modifications to one of the group elements (no movement, just updating some parameters) then finds the other instances and replaces them. The trouble is that the replaced groups don't end up in the same spot as they were before & they lose their mirroring. See attached pictures. Is there any way to store the location differently or save the transformations applied to a group so it doesn'y do this? Using Revit 2013. Any help would be appreciated! Code:
public void updateUnitProperties(Group unit) { Document doc = unit.Document; ICollection<ElementId> grpElements = unit.UngroupMembers(); GroupSet unitInstances = getOtherInstancesOfUnit(doc, unit); GroupType oldGroupType = unit.GroupType; String oldGroupName = unit.GroupType.Name; Group newUnit = doc.Create.NewGroup(grpElements); GroupType newGroupType = newUnit.GroupType; if (unitInstances.Size > 0) { foreach (Group unitInstance in unitInstances) { LocationPoint locPt = unitInstance.Location as LocationPoint; Group newGroupInstance = doc.Create.PlaceGroup(locPt.Point, newGroupType); doc.Delete(unitInstance); } doc.Delete(oldGroupType); newGroupType.Name = oldGroupName; } }
Solved! Go to Solution.