Change color/highlight specific elements from MEP and ELE programmatically

Change color/highlight specific elements from MEP and ELE programmatically

sivaranjani.jayaprakash
Participant Participant
673 Views
2 Replies
Message 1 of 3

Change color/highlight specific elements from MEP and ELE programmatically

sivaranjani.jayaprakash
Participant
Participant

Hi,

I am new to Revit APIs. I am figuring out ways to highlight only selected elements from pipes and lighting devices by changing their colors to bright red or so, similar to Paint functionality for Walls. I also want the highlight to remain in the render as well. How can I do that in Revit and also is there a way to achieve it programmatically using element ids (I see that this can be achieved for solid elements using Paint API, but Paint doesn't seem to work for Pipes if I am not wrong). Any leads in this regard will be helpful. Thanks.

0 Likes
674 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Welcome to the Revit API!

 

First of all, I recommend looking carefully at the getting started material:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#2

  

Also, you should always explore how to solve a task in the user interface before trying to address it programmatically. Otherwise, you might end up wasting a lot of effort going in the wrong direction.

  

If you want to dive straight in to programming, though you can take a look at the Revit SDK samples VisibilityControl and ViewFilters.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

AGGilliam
Collaborator
Collaborator

I would look into the SelectionFilterElement class. You could create a filter based on your current selection and apply it to the view, setting everything in the selection to a specific color using OverrideGraphicSettings like in the example from the SelectionFilterElement link.

0 Likes