change colour of extrusion object

change colour of extrusion object

dirk.neethling
Advocate Advocate
5,017 Views
4 Replies
Message 1 of 5

change colour of extrusion object

dirk.neethling
Advocate
Advocate

I successfully created an Extrusion. How can I change the colour of the resulting Sweep object, in this case from the Default Grey to black?

Regards, Dirk

 

extrusion_object.png

0 Likes
5,018 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

Dear Dirk,

 

The number of possible ways to control the colour of a Revit element is rather daunting:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.24

 

I would say take your pick...

 

Also, always ask a product or content creation expert how this is best achieved through the user interface before even thinking about approaching it programmatically.

 

Please let us know how you end up solving this.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5

dirk.neethling
Advocate
Advocate

Hello Jeremy,

 

the solution under

 

http://thebuildingcoder.typepad.com/blog/2011/03/change-element-colour.html

 

looks good, however it's for a Project. Is there a similar solution for a FamilyDocument?

Regards, Dirk

0 Likes
Message 4 of 5

dirk.neethling
Advocate
Advocate

Hello Jeremy,

 

OK, I found this method under [https://forums.autodesk.com/t5/revit-api-forum/how-change-the-color-a-element/td-p/5651177] which sort of works:

 

            Color color = new Color(0, 0, 0); // RGB (0, 255, 255)
            OverrideGraphicSettings ogs = new OverrideGraphicSettings();
            ogs.SetProjectionLineColor(color);
            ogs.SetProjectionFillColor(color);
            ogs.SetCutFillColor(color);
            ogs.SetCutLineColor(color);
            doc.ActiveView.SetElementOverrides(fiProfile.Id, ogs); 

The problem is my ELement is a Family instance of a Sweep. So the Projection lines are in the right Color, but the Element itself is not really a solid, but just a composite of the projection lines. Thus the question becomes, how can I convert a FamilyInstance of a Sweep into a solid?

 

Regards, Dirk

0 Likes
Message 5 of 5

jeremytammik
Autodesk
Autodesk

Maybe the correct approach is to assign various subelements of your family definition different subcategories, and assign appropriate materials to those.

 

Ask a content creation expert, or explore it from the UI yourself.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes