Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Controlling Whether Objects are Selectable

mhillis
Advocate

Controlling Whether Objects are Selectable

mhillis
Advocate
Advocate

Hello All,

 

I am working on an add-in and will utilize this add-in to insert objects into a Revit Document.  These objects will be various families such as Duct Fitting Families.  I am currently utilizing the DirectShape API to render previews of the object I am creating, let's call these preview objects.  My dilemma is that when a preview object is in the and visible on screen, it is selectable by the user.  I do not want this as I want to be in the add-in to have complete control of displaying, manipulating and disposing of the preview object.

 

I see two ways to go about this, I can either disable user input into the project viewports all together or I can somehow toggle whether or not the preview object I am creating can be 'selected'.  I would much rather go for the latter as it is more directly what I am looking to do.

 

Does anyone have any suggestions on disabling an objects ability to be selected by the user?

 

Thanks! 

0 Likes
Reply
270 Views
1 Reply
Reply (1)

jeremytammik
Autodesk
Autodesk

When your own add-in prompts the user to select elements, you have full control over each element selectability through the ISelectionFilter interface:

  

https://www.revitapidocs.com/2020/d552f44b-221c-0ecd-d001-41a5099b2f9f.htm

  

Unfortunately, I am not aware of any similar mechanism for manipulating or controlling Revit's built-in selection process.

 



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

0 Likes