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: 

How can I access Visibity/Graphic Overrides -> Filters, through API ?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Bruno_Neves_Pires_Silva
1080 Views, 3 Replies

How can I access Visibity/Graphic Overrides -> Filters, through API ?

Hello, 

  

    How can I access Visibity/Graphic Overrides -> Filters, through API ?

    Please see the attached screenshot.

    I needto check the collors of Lines and Patterns.

 

 

Thank you in advance.

3 REPLIES 3
Message 2 of 4

Hi,

 

in the active view :

 

ICollection<ElementId> lstFilterView = doc.ActiveView.GetFilters();
foreach (ElementId filterId in lstFilterView)
{
    FilterElement fltelmnt = doc.GetElement(filterId) as FilterElement;

    //YOUR CODE

}

 

Smiley Wink

 

 

 



PIRO Charles
Developer

PIRO CIE
Linkedin


Message 3 of 4

Thank you, Charles.

 

     But how can I get the color of the lines and patterns ?

   This class FilterElement dont have this properties.

Message 4 of 4

I think I got it:

 

Snippet

Document doc = App.ActiveUIDocument.Document;
 
           Autodesk.Revit.DB.View vista = doc.ActiveView;
           ICollection<ElementId> lstFilterView = vista.GetFilters();
           foreach (ElementId filterId in lstFilterView)
           {
               FilterElement fel = doc.GetElement(filterId) as FilterElement;
               OverrideGraphicSettings cfg = vista.GetFilterOverrides(fel.Id);                
 
           }

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community