GetChangeTypeParameter not triggered for INSTANCE_LENGTH_PARAM

GetChangeTypeParameter not triggered for INSTANCE_LENGTH_PARAM

harrymattison
Advocate Advocate
2,074 Views
11 Replies
Message 1 of 12

GetChangeTypeParameter not triggered for INSTANCE_LENGTH_PARAM

harrymattison
Advocate
Advocate

Hi,

 

I want to use Dynamic Model Update to detect when a family instance such as a beam changes length. The trigger below for ALL_MODEL_MARK works fine. When you change the instance mark of a beam, the updater is triggered.

 

But when you make the beam longer or shorter (which changes INSTANCE_LENGTH_PARAM), the updater does not trigger. Why not?

 

Thanks

Harry

 

    public void registerUpdater()
    {
        TestUpdater updater = new TestUpdater(this.Application.ActiveAddInId);
        UpdaterRegistry.RegisterUpdater(updater, true);

        UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),
            new ElementClassFilter(typeof(FamilyInstance)),
            Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.ALL_MODEL_MARK)));
  
        UpdaterRegistry.AddTrigger(updater.GetUpdaterId(),
            new ElementClassFilter(typeof(FamilyInstance)),
            Element.GetChangeTypeParameter(new ElementId(BuiltInParameter.INSTANCE_LENGTH_PARAM)));        

    }
    
public class TestUpdater : IUpdater
    {
        static AddInId m_appId;
        static UpdaterId m_updaterId;
        public TestUpdater(AddInId id)
        {
            m_appId = id;
            m_updaterId = new UpdaterId(m_appId, new Guid("FB2BF2B1-4C06-42d4-27C1-D1B4EB593EFA"));
        }
        public void Execute(UpdaterData data)
        {
            TaskDialog.Show("Test","Executing DMU updater");
            foreach (ElementId id in data.GetModifiedElementIds())
            {
                Element e = data.GetDocument().GetElement(id);
                TaskDialog.Show("d","Length = " + e.get_Parameter(BuiltInParameter.INSTANCE_LENGTH_PARAM).AsDouble());
            }
            
        }
        public string GetAdditionalInformation() { return "test"; }
        public ChangePriority GetChangePriority() { return ChangePriority.FloorsRoofsStructuralWalls; }
        public UpdaterId GetUpdaterId() { return m_updaterId; }
        public string GetUpdaterName() { return "test"; }
    }

0 Likes
2,075 Views
11 Replies
Replies (11)
Message 2 of 12

Aaron.Lu
Autodesk
Autodesk
Hi Harry, I can reproduce your problem.

The developer's reply is: the length is a calculated value rather than a DB value, so it is different from other types of parameter, so it is not a defect, but we can make a wish for it:
CF-3763 DMU: Be able to trigger beam length change (INSTANCE_LENGTH_PARAM)


Aaron Lu
Developer Technical Services
Autodesk Developer Network
Message 3 of 12

Anonymous
Not applicable
Hi Aaron,
Thanks for logging that wish. It might be even better if we were able to trigger on change to any user visible parameter of the element. Or maybe just simply any BuiltInParameter. I can see the issue though, in that the DB is probably only storing endpoints so now we're talking about Revit keeping track of total current (calculated) state of the element though, this is effectively what we would have to do externally to catch this change ourselves. (extensible storage system to track previous length or something)

This also makes me wonder if it's possible to trigger on changes to a shared parameter associated with the element. Do you happen to know if that is possible currently?

Thanks again!
Message 4 of 12

Aaron.Lu
Autodesk
Autodesk
using Element.GetChangeTypeParameter method, you can pass a parameter to it, so the parameter can be a shared parameter. does it work?


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 5 of 12

Anonymous
Not applicable
Thanks Aaron, I'll give it a try, this would be most helpful.
0 Likes
Message 6 of 12

arnostlobel
Alumni
Alumni

I was CCd on the developer's reply to Aaron (see above) and - personally - I disagree with her. I do think it is a defect of sort if an updater does not trigger on a changed built-in parameter. It should not matter (but it does, unfortunately, in some cases), whether a parameter is calculated or has direct connection to data in the model. In my opinion both cases should trigger updaters. I'll see if I can push it forward. Sorry about that not working.

 

Jeremy, if you have filed a wish-list item for it already, can you change it to a defect, please? (CC me on that one. Thanks)

Arnošt Löbel
Message 7 of 12

Aaron.Lu
Autodesk
Autodesk
Hi Ken, I've created an issue for it: CF-3763
thanks for reporting this.


Aaron Lu
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 8 of 12

Anonymous
Not applicable

I haven't been able to find further information on the status of this item outside this thread. Has this issue been resolved in any version releases since 2018? I'm running into the same issue trying to trigger based on the built-in parameter RBS_ELEC_CIRCUIT_WIRE_SIZE_PARAM.

Message 9 of 12

abdelrahmanfathe95
Participant
Participant

Is there any solution to this problem in revit 2021.

Message 10 of 12

tomerFUNPJ
Enthusiast
Enthusiast
+1
Any updated about this?
Message 11 of 12

henriquefurlaneto
Explorer
Explorer

Is there any change on this?
I'm having the same issue with COLUMN_LOCATION_MARK

0 Likes
Message 12 of 12

alisa_wachs_M3
Contributor
Contributor

Same issue with:

LEVEL_PARAM that is used for Floors & Ceiling, 

ROOF_BASE_LEVEL_PARAM used for FoorPrintRoof,

TRUSS_ELEMENT_REFERENCE_LEVEL_PARAM used for Truss

 

while all of the above are IsReadOnly: False, UserModifiable: False... the same applies for the parameters below that do trigger as expected:

FAMILY_BASE_LEVEL_PARAM,

FAMILY_LEVEL_PARAM,

WALL_BASE_CONSTRAINT,

STAIRS_RAILING_BASE_LEVEL_PARAM

 

What gives? We need to have ability to track changes across different types and at least be consistent about it!

0 Likes