Parameter Change of Group Member Causing Geometry Change of Other Instances

Parameter Change of Group Member Causing Geometry Change of Other Instances

Sean_Page
Collaborator Collaborator
332 Views
6 Replies
Message 1 of 7

Parameter Change of Group Member Causing Geometry Change of Other Instances

Sean_Page
Collaborator
Collaborator

I am seeing some odd things happening with a Dynamic updater for Wall when the Wall is part of a group.

 

  1. Draw a Wall and if that Wall Type has a Fire Rating
  2. Place Wall in a Group and then create new Group instances
  3. Update a Parameter of an instance of the Wall in one of the Groups
    1. The instance being edit triggers the ParameterChangeType associated in the Updater Trigger
    2. ALL other instances in ALL other groups trigger GeometryChanges 

 

See the attached video for what I am seeing when I do this.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Register and set generic triggers:

Updaters.WallUpdater wallRatingUpdater = new Updaters.WallUpdater(application.ActiveAddInId);
UpdaterRegistry.RegisterUpdater(wallRatingUpdater, true);
ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));
UpdaterRegistry.AddTrigger(wallRatingUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeElementAddition());
UpdaterRegistry.AddTrigger(wallRatingUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.ELEM_TYPE_PARAM)));
UpdaterRegistry.AddTrigger(wallRatingUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.ALL_MODEL_MARK)));
UpdaterRegistry.AddTrigger(wallRatingUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeGeometry());

 

Adding the Trigger for the shared parameter after document Open to verify it exists:

if(SharedParameterElement.Lookup(doc, new Guid("Parameter_Guid")) is SharedParameterElement sharedAssemblyType)
{
    if(sharedAssemblyType.GetDefinition() is InternalDefinition wallAssemblyType)
    {
        Updaters.WallUpdater wallUpdater = new Updaters.WallUpdater(application.ActiveAddInId);
        ElementClassFilter wallFilter = new ElementClassFilter(typeof(Wall));
        UpdaterRegistry.AddTrigger(wallUpdater.GetUpdaterId(), wallFilter, Element.GetChangeTypeParameter(wallAssemblyType.Id));
    }
}

 

This is inside the updater working on each type of trigger:

Sean_Page_0-1734018731559.png

 

 

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
333 Views
6 Replies
Replies (6)
Message 2 of 7

GaryOrrMBI
Collaborator
Collaborator

This would be expected behavior. The very purpose of a group is so you can make a change to one instance of that group and all other instances of that group will experience the same change. Therefore, you change one instance and Revit changes all the other instances of the same group type. Six instances, six elements get changed, six triggers, etc. you will need to check to see if an element is a member of a group and, if so, set a flag to skip updating any other elements of that type that are members of that same group definition...

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes
Message 3 of 7

Sean_Page
Collaborator
Collaborator

@GaryOrrMBI, I understand that a trigger would be thrown, but the part that doesn't make sense to me is why does the first change fire the Parameter trigger and all the rest fire the Geometry changed trigger? I would expect ALL of them to be fired by the same trigger and it definitely shouldn't be a Geometry Change for a Text Parameter.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
Message 4 of 7

GaryOrrMBI
Collaborator
Collaborator

aaaahhhh... I didn't look at this closely enough... 

I do know that Revit treats groups, and the members thereof, oddly when referencing them via the API (often even from within the GUI). Is the Geometry changed event triggering on the wall(s) within the group instances as having been changed or is it triggering on a modification to the group instance itself? The geometry changed may be coming from each group instance having experienced a change, the parameter change is on a group member, but the group itself isn't experiencing a parameter change???

 

-G

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes
Message 5 of 7

Sean_Page
Collaborator
Collaborator

The trigger is specifically on the typeof(Walls) so the Group itself shouldn't be triggering the change no. The one thing that I did notice is that when I watch the geometry properties of the walls changed, the hash is different before and after the change, so maybe that is where its coming from, but again, doesn't seem like it should be doing that.

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes
Message 6 of 7

GaryOrrMBI
Collaborator
Collaborator

@Sean_Page wrote:

 

but again, doesn't seem like it should be doing that.

I agree, seems odd no matter how you look at it. Hopefully someone else can chime in with some thoughts because we're beyond what I can offer up.

Good luck.

Gary J. Orr
GaryOrrMBI (MBI Companies 2014-Current)
aka (past user names):
Gary_J_Orr (GOMO Stuff 2008-2014);
OrrG (Forum Studio 2005-2008);
Gary J. Orr (LHB Inc 2002-2005);
Orr, Gary J. (Gossen Livingston 1997-2002)
0 Likes
Message 7 of 7

Sean_Page
Collaborator
Collaborator

@GaryOrrMBI, you may have led me to something.

If I change the parameter value WHILE in Group Edit mode then the Geometry trigger fires when I save the group.

 

If I just tab through and change the parameter ONLY the Parameter trigger fires. So, something with what the Group is doing on save is in fact triggering a geometry update on the walls, however, it appears that the trigger is firing on the OTHER adjacent wall, not the wall with the changed Parameter.

 

Group Edit Mode (Mark 2):

Sean_Page_1-1734041063832.png

 

Finish Group Edit (Mark 3)

Sean_Page_2-1734041129121.png

 

 

 

Sean Page, AIA, NCARB, LEED AP
Partner, Computational Designer, Architect
0 Likes