I do nothing at all that cannot be shared and published, and share and publish absolutely everything I work on.
I therefore avoid discussing questions like this, and actually all questions whatsoever, one-on-one.
I prefer discussing everything in public and enabling the entire community to contribute and share:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1
Therefore, please post your query as a question on the Revit API discussion forum, Stack Overflow, or a comment on an appropriate discussion on The Building Coder blog, both for knowledge sharing and so others can chip in with answers as well:
http://forums.autodesk.com/t5/Revit-API/bd-p/160
http://stackoverflow.com/questions/tagged/revit-api
Thank you!
That has several advantages. Among others, your peers can join in and help you, and our conversation becomes visible to others, to help them resolve their issues as well.
I know that you already did this:
Thank you for that.
I wish you patience and good luck.
Alternatively, you can try to find a solution for yourself, e.g. by searching on the Internet and elsewhere.
I would have to do the same thing.
Maybe nobody is answering because the answer is out there already?
Best regards
Jeremy
Sorry for this weird answer.
It happened because the public forum question was reposted as a private message.
I do not reply to private messages except in the manner that you can see above.
Thank you for your understanding!
Hi,
Settings settings = doc.Settings;
Categories cats = settings.Categories;
Category lineCat = cats.get_Item(BuiltInCategory.OST_Lines);
Category lineStyleCat = cats.NewSubcategory(lineCat, "MyLineStyle");
lineStyleCat.LineColor = new Color(0, 0, 255);
lineStyleCat.SetLineWeight(2, GraphicsStyleType.Projection);
Revitalizer
Edit: don't mark it as solved if the code does not work...
Changed
Category lineStyleCat = lineCat.NewSubcategory(lineCat, "MyLineStyle");
To
Category lineStyleCat = cats.NewSubcategory(lineCat, "MyLineStyle");
Now it will function as desired 😉