- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I’m writing an addon that changes all the line styles of Detail Lines, Model Lines and the boarders of Filled Regions to a certain line style. But I'm having issues with distinguishing user built line styles from system / inbuilt ones.
To get all the lines styles and including the user and system ones, I use a FilteredElementCollector to find class GraphicsStyle:
IList<Element> getgs = new FilteredElementCollector(doc).OfClass(typeof(GraphicsStyle)).ToElements();
This works but returns a lot of styles some unrelated to lines, but I can use the GraphicStyleCategory then Parent then Name to find styles with the parent name “Lines”:
if (mystyle.GraphicsStyleCategory.Parent.Name == "Lines")
So now I have all the line styles, but I want to remove the system ones, which I thought were lines styles within < and >, such as <Thin Lines> or <Wide Lines>.
But, looking at the names that are returned, some have <>, some have only a > at the end and others don't have anything to distinguish them. These are the names returned:
<Room Separation>
<Insulation Batting Lines>
<Sketch>
<Lines>
<Thin Lines>
<Medium Lines>
<Wide Lines>
<Overhead>
<Hidden>
<Demolished>
<Beyond>
Boundary>
Riser>
Run>
Landing Center>
<Area Boundary>
<Hidden Lines>
<Space Separation>
<Lines>
<Lines>
<Lines>
Stair Path>
<Fabric Envelope>
<Fabric Sheets>
Railing Rail Path Lines
Railing Rail Path Extension Lines
<Centerline>
<Axis of Rotation>
<Path of Travel Lines>
<Load Area Separation>
MyStyle
Seems a little inconsistent to me... Is there any good way to pick out the 'system' line styles so that I can only find ones the user has created?
Cheers!
Solved! Go to Solution.