Export Object Styles

Quick question, has anyone seen a way to grab all project object styles?

 

I have been trying to do this my self. To the best of my knowledge there is not a way with out using the API. I think I could figure out how to code it but cannot find it in the API. That place is like a labyrinth

Hi Timon & Steven,

Kulkul, thank you. It looks like you are using the python to get all the names of to identify the CAD lines in the project. I’ll be doing a similar thing, but with model object styles. I’m going to see if I can modify it to read the Line Weight, Color, Pattern and Material as well.

Using something similar to what I saw in your python node, I was able to identify all the object styles in the project. The next step is to read the Line Weight, Color, Pattern and Material.

Good Luck!

Hi Kulkul,

Thank you for the code. I have not had time to mess around with it but wanted to get back to you while it was still fresh in your head. I was hoping to get the line weight set in the Object Styles. I am a complete noob at coding but looking over it would the only thing that needs to be change in line 26, 39, and 40? In stead of “GraphicsStyleCategory” change it to “GraphicsStyleType”?

I have search the API high and low and this is all I could fined that seamed like the right section.

Link 1

Link 2

Link 3

Edit: Missed the fact that this was for imported objects. I am guessing that it would take more than just changing the three lines I suggested.

Added dynamo script to previous post

Its a little hard to see. Is yours just exporting the names of the Object Styles?

Timon (or anyone who’s accomplished this), could you post the code? The screenshot doesn’t show any names (or your modified Python) and I’m having trouble filtering to the Model & Annotation categories. I found an add-in for Revit that exports to Excel EXCEPT that it doesn’t include Line Pattern (or Material) in the export! It DOES include a list of Materials (and Line Styles, etc.), but not a list of Line Patterns… If they fix that add-in to include the full functionality that I need, I’d probably call it good, but it would be better if I could find a coding solution so that I can add some of my own processing logic before generating the output file. :slight_smile: Thanks!

 

 

Hope this helps. It still doesn’t export the line styles, but is a step in the right direction. I want to be able to export the information about default graphics settings. Line width, pattern, etc.

1 Like