IUpdater does not work?

IUpdater does not work?

ricaun
Advisor Advisor
1,794 Views
7 Replies
Message 1 of 8

IUpdater does not work?

ricaun
Advisor
Advisor

Hello Devs

 

I create an application to test when the IUpdater is triggered and what BuiltInParameter was the source of the trigger.

 

Here is the video about the plugin and the IUpdater problems.

 

 

By default, the application adds all the BuiltInParameter on the IUpdater trigger.

 

Some parameters trigger normally and others do not trigger... Maybe IUpdater does not work with all BuiltInParameter in Revit. Maybe is a feature not a bug.

 

Another thing I test was in Revit 2023 and I noticed the parameter BuiltInParameter.LEADER_LINE stop triggering.

 

 

Now I'm worried to use IUpdater with parameters, my application could break if I use a parameter that decides to stop triggering in Revit 2024 for some reason.

 

Here is some BuiltInParameter that does not trigger using IUpdater.

BuiltInParameter.ELEMENT_LOCKED_PARAM
BuiltInParameter.TAG_LEADER_TYPE
BuiltInParameter.LEADER_LINE (Revit 2023)

This list is what I found but testing manually, I am pretty sure has more BuiltInParameter that does not trigger by IUpdater.

 

If you what to download and test the application: https://github.com/ricaun-io/RevitAddin.UpdaterTester

 

Related Posts:

See yaa!

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

1,795 Views
7 Replies
Replies (7)
Message 2 of 8

Kevin.Lawson.PE
Advocate
Advocate

Yes, Some parameters don't have the proper reporting mechanisms implemented. Autodesk is aware of the problem, here's a post from Arnost back in 2015: https://forums.autodesk.com/t5/revit-api-forum/instance-elevation-param-change-is-not-firing-updater...

 

I know BuiltInParameter.INSTANCE_FREE_HOST_PARAM also doesn't report.  I ended up using Element.GetChangeTypeAny() and then checking the parameter in the Execute function. 

 

I didn't realize that parameters were losing functionality across versions. That is concerning. 

-Kevin Lawson, PE
www.rippleengineeringsoftware.com
Revit heating and cooling load calculations in one click!
Message 3 of 8

jeremy_tammik
Alumni
Alumni

Thank you very much for all your work, documentation and careful analysis! I added it to the existing internal discussion thread for the devteam to digest and enjoy...

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 4 of 8

ricaun
Advisor
Advisor

@Kevin.Lawson.PE I have seen another topic related to the BuiltInParameter.INSTANCE_FREE_HOST_PARAM no triggering...

 

The annoying part about using Element.GetChangeTypeAny() is that you don't know what causes the change, tracking the old value and compare with the updater value.

 

Are you doing something like this?

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 5 of 8

Kevin.Lawson.PE
Advocate
Advocate

Yes, that's exactly what I'm doing.  If the parameter should be checked against information in the family or model, you can just check on GetChangeTypeAny().  If you need to compare against an old parameter value, you can use a storage schema: https://thebuildingcoder.typepad.com/blog/2011/04/extensible-storage.html 

-Kevin Lawson, PE
www.rippleengineeringsoftware.com
Revit heating and cooling load calculations in one click!
0 Likes
Message 6 of 8

ricaun
Advisor
Advisor

I probably use memory instead of using Extensible Storage.


When the document opens get all ElementId and initial Parameter values.

If the Uptader is triggered just compare with the initial list and if is different do something. Also could add the Element.GetChangeTypeElementAddition and Element.GetChangeTypeElementDeletion to update the list if some is change on the document.

 

Gonna try some code after lunch.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes
Message 7 of 8

Sean_Page
Collaborator
Collaborator

Are we to assume that any "calculated" value will not trigger the updater? I am working with walls and the Area, Volume, nor Length parameters fire, but the Height, Mark, and Type all do. So essentially, any parameter that isn't user modifiable won't trigger an updater?

Sean Page, AIA, NCARB, LEED AP
Senior Partner, Computational Designer, Architect
0 Likes
Message 8 of 8

ricaun
Advisor
Advisor

Maybe could be related.

 

When using a IUpdater to trigger with BuiltInParameter.CURVE_ELEM_LENGTH that is the parameter for Length in the Wall.

 

The trigger works when a wall is extended, changing the length of the Curve. But in the UpdateData the IsChangeTriggered is false when BuiltInParameter.CURVE_ELEM_LENGTH is used.

 

 

public void Execute(UpdaterData data)
{
    var elementId = data.GetModifiedElementIds().First();
    var changeTypeParameter = Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.CURVE_ELEM_LENGTH));
    var isLengthChangeTriggered = data.IsChangeTriggered(elementId, changeTypeParameter);
}

 

 

In my tests when changing the curve Length of the wall the updater is trigger without the IsChangeTriggered.

 

Here is a full Unit Test: https://github.com/ricaun-io/RevitTest.Updater

 

 

I could try some other internal Revit parameters to see if the updater trigger or not.

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils