IUpdater not responding to offset parameter changes in Revit 2016?

Anonymous

IUpdater not responding to offset parameter changes in Revit 2016?

Anonymous
Not applicable

Hi,

 

so I have a updater that I want to trigger on changes to the offset parameter of familyinstances.


So I register it like this:

 

Snippet

RevitUpdater updater = new RevitUpdater(uiapp.ActiveAddInId);
 
if(!UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId()))
{
    UpdaterRegistry.RegisterUpdater(updater);
    if (!UpdaterRegistry.IsUpdaterEnabled(updater.GetUpdaterId()))
        UpdaterRegistry.EnableUpdater(updater.GetUpdaterId());
 
        
 
    UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),new ElementClassFilter(typeof(FamilyInstance)),Element.GetChangeTypeParameter(new ElementId((int)BuiltInParameter.INSTANCE_FREE_HOST_OFFSET_PARAM)));
    UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),new ElementClassFilter(typeof(FamilyInstance)),Element.GetChangeTypeParameter(new ElementId((int)BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS)));
}

 

I've added the comments parameter to just to make sure Im not doing anything wrong. 
I kicks in just like expected when I change the instance comment, but the offset only kicks in when the user sets the value of the offset by entering a value in the properties.
If the user moves the element and the offset gets changed because of this, nothing happens. This cannot be excepted behaviour, right?

Do I have to add a trigger for element geometry changed?

 

Thanks!

Erik

0 Likes
Reply
351 Views
2 Replies
Replies (2)

jeremytammik
Autodesk
Autodesk

Dear Erik,

 

Thank you for your query.

 

This topic or closely related issues were discussed several times here in the forum and answered by Arnošt, who has now unfortunately left the company.

 

Please try using the Element.GetChangeTypeAny method:

 

http://thebuildingcoder.typepad.com/blog/2015/06/dynamo-centroid-volume-calculation-migration-blitz....

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

Anonymous
Not applicable

Hi Jeremy,

 

Oh no!! Arnošt left!? That is such sad news.

 

I gave it a go with the geometry change, and it works, but I wanted it to unly fire when needed.

 

Thanks Jeremy

 

0 Likes