Current Selection doesn't report ProjectBrowser's selections
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When user selects items in the model, they typically are accessible via the API by grabbing the UIDocument selection. That also, works for some of the selections made via the Project Browser. Let's take for example an idea to override the ID_DELETE_BUTTON command. If you override the delete command, you could see what's being deleted by grabbing current selection from the document. That's not going to work for Families selected in the Project Browser. Nothing is being added to the selection for that category. To re-create this just:
- override ID_DELETE_BUTTON command
- access selection in the handler for the command override and see what's being shown as selected
- select family from the Project Browser, and hit delete. Nothing will be reported in the selection. That's not correct because Revit would normally delete all instances and types of that family and then unload that family itself. Selection here should report at least the family, so we can track down all types/instances. Otherwise overriding delete command is going to be impossible/tricky.
Bear in mind that if you were to select + delete a view, sheet, schedule, legend, group etc. via Project Browser and deleted it, selection would report properly what is being selected/deleted.
Thoughts? @jeremytammik
I guess if my goal here is to override the delete command so that I can capture what is being deleted, would there be another way to get that data. Document Changed event is a no go, because by the time it fires, deleted ids are not valid anymore so I cannot get info about deleted elements. Any suggestions would be welcome here.