Could GeometryObject with an invalid GraphicsStyleId be visible?

Could GeometryObject with an invalid GraphicsStyleId be visible?

shushenrui1996
Contributor Contributor
414 Views
2 Replies
Message 1 of 3

Could GeometryObject with an invalid GraphicsStyleId be visible?

shushenrui1996
Contributor
Contributor

Hi. I want to filter invisible GeometriyObjects by their category with Revit API. But I notice that some invisible GeometriyObjects belong to a visible category and their GraphicsStyleId is invalid(-1). Can I filter them based on their invalid GraphicsStyleId ? Could visible geometry in the view have an invalid GraphicsStyleId as well?Thank you!

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

jeremy_tammik
Alumni
Alumni

I do not believe that you can conclude much from the GraphicsStyleId. Revit has a large and complex graph of setting at different levels that control graphical appearance of object. Moreover, the appearance of each object can vary by view and other circumstances. I look forward to hearing what you can find out, though! Good luck!

  

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

shushenrui1996
Contributor
Contributor

Sorry for not describing my problem in detail and here is what problem I met before;

I got a *.rvt file which has a Mass with an imported DWG file. And in the Visibility/Graphics Overrides Filter, the DWG is set invisible by ‘Imported Categories- Imports in Familys’. So I use the GeometryObject.GraphicStyldId to get the GraphicsStyleCategory, and filter them by the visibility of GraphicsStyleCategory. It works well for allthe Lines and Arcs of the DWG file. However, for some surfaces,  the GraphicStyldIds are Invalid so I cant reach their GraphicsStyleCategories.

Is there something wrong in this method? Thank you!

 

shushenrui1996_2-1636106027060.png

Fig1. The mass and the DWG File(Set Invisible In the Origin File)

shushenrui1996_0-1636105446257.png

Fig2. Where the DWG file is set invisible

shushenrui1996_1-1636106014017.png

Fig3. The Surfaces whose GraphicsStyleCategories isInvalid

shushenrui1996_4-1636106383812.png

Fig.4 What I get Afetr the Filtering

0 Likes