Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Controlling Whether Objects are Selectable

1 REPLY 1
Reply
Message 1 of 2
mhillis
256 Views, 1 Reply

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

Controlling Whether Objects are Selectable

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! 

1 REPLY 1
Message 2 of 2
jeremytammik
in reply to: mhillis

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

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report