0

Is there a way to determine that a user is interacting with the Type Selector of the Properties Palette?

I do see these journal entries:

' 0:< Unnecessary nesting;d:\sunrise\2016_px64\source\revit\desktopmfc\ui\PropertiesPaletteView.cpp;1741;ID_CHANGE_SYMBOL ;N++EB(NB); ' 0:< Appendable opton;-;d:\sunrise\2016_px64\source\revit\desktopmfc\ui\PropertiesPaletteView.cpp;1144;IDS_MODIFY_TYPE_ATTRIB ;N--OB(NAB);

But it's hasn't been enough of a clue to tell me how I might be notified of this event.

Jeff

JGeerWM
  • 810
  • 10
  • 16

2 Answers2

1

I do not believe there is any direct notification of that specific interaction from the UI point of view.

If the user makes a modification to an element, including and not limited to that specific UI interaction, you can be notified by hooking in to the Dynamic Model Updater Framework DMU:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • The challenge for me is knowing that the Type was modified. If the property palette is used to change parameter values, I'm not so concerned. When they change the type of only two conduit, excluding a conduit fitting such as elbow, that's a problem. – JGeerWM Jul 21 '16 at 17:05
  • types have parameters as well, you know. you might also want to check out the ElementTypeDuplicating and ElementTypeDuplicated events, and this thread in the Revit API discussion forum: http://forums.autodesk.com/t5/revit-api/how-to-track-family-type-duplicate-and-reset-e-g-keynote/m-p/6443898 – Jeremy Tammik Jul 22 '16 at 18:21
  • Thanks for the suggestion. I've implemented the ElementTypeDuplicating event hander, but it is not triggered when using the Type Selector drop-down from the properties palette. – JGeerWM Jul 25 '16 at 13:42
  • Jeremy, Thank you for all your help. I went the DMU route with a good deal of success. I am able to test if the modified conduit conforms to some predefined standards, and create a failure definition if it doesn't. I am running into an issue in Revit 2014, where Revit crashes after displaying the error dialog box. The error in the journal reads: DBG_INFO: Detected unfrozen change of selection.: line 571 of n:\build\2014_ship_x64_inst_20130308_1515\source\revit\revitui\modscope\ModScope.cpp. – JGeerWM Aug 01 '16 at 21:16
  • Is there something I am failing to do in the below code: if (invalidConduitIds.Any()) { var failureMessage = new FailureMessage(invalidConduitSizeFailureId); failureMessage.SetFailingElements(invalidConduitIds); doc.PostFailure(failureMessage); } – JGeerWM Aug 01 '16 at 21:20
  • I also found the following journal entries: ' 0:< DBG_WARN: Overflow index in getCurrentFilterItem.: line 334 of UI\PropertiesPaletteFilter.cpp. ' 0:< DBG_WARN: Invalid pPropertiesCategoryInfo.: line 381 of n:\build\2014_ship_x64_inst_20140709_2115\source\revit\desktopmfc\managers\ManagePropertiesPalette.cpp. ' 0:< DBG_WARN: Cannot found a valid index according to the current filter item.: line 517 of n:\build\2014_ship_x64_inst_20140709_2115\source\revit\desktopmfc\managers\ManagePropertiesPalette.cpp. ' 0:< Exception occurred Note that I installed Update 3 for Revit 2014. – JGeerWM Aug 01 '16 at 21:50
0

I just noticed your additional background information in a private message:

"I am trying to detect when someone changes the type of conduit in Revit by using the Type Selector in the properties palette...

The problem with this approach is that the user may change the type of the 2 conduit, but that leaves the 1 conduit fitting unmodified, and incompatible.

Using the Change Type command from the Modify ribbon is the approach that gives the best result.

I would like to detect if the uses is interacting with this dialog and give some warning. Is this possible?"

Again, I do not think that you can distinguish how the different elements were modified, or by what UI means, but you definitely can use DMU to determine that some elements have been modified, and how, and issue a warning or even correct the modification if you think it is inappropriate.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17