Applying Material to solid

Applying Material to solid

sobon.konrad
Advocate Advocate
2,621 Views
5 Replies
Message 1 of 6

Applying Material to solid

sobon.konrad
Advocate
Advocate

I have been looking all over (Jeremy's blog, SDK Samples, google etc) to find an answer to this question. I remember seeing an example on Jeremy's blog where he was able to add a material to geometry face. Now, in Revit 2016 a Face doesn't have that optin anymore. I believe Jeremy's example was in Revit 2009. Anyways, I am looking for confirmation that there is/is not a way to add/apply a material to a face of a solid, or entire solid at once. If I don't have to loop through all faces then i would like to avoid that. 
Is Paint() the only way to add Material to a solid that already exists? 
Is GeometryUtils and all of the Solid creation overloads the only way to apply material to a solid? Is it only possible on creation? Can it be done afterwards? 

Thanks! 

0 Likes
Accepted solutions (1)
2,622 Views
5 Replies
Replies (5)
Message 2 of 6

rosalesduquej
Alumni
Alumni

Hi Konrad,

 

I saw a similar post to applying materials with the Revit API. In one part of the post, one of our forum contributors suggested to use FreeFormElement Class.

 

"since you are in Family context, you could use FreeFormElements, based on your Solids. Once created such a FreeFormElement, you can assign a subcategory, add FamilyParameters and so on."

 

Here is the link to the Forum post. https://forums.autodesk.com/t5/revit-api/applying-a-material-to-a-directshape/td-p/5745839

 

And as far as I know, you are correct with Paint() being the way to add the material to an existing solid. 

 

Here is more information about it. http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-BE4672C9-E8BB-4157-8A2C-9067113FC55E

 

Hope this helps to clarify your question.

 



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
0 Likes
Message 3 of 6

sobon.konrad
Advocate
Advocate

Jaime,

 

Thank you for the answer. I will test both methods and report any results. However, can we make this an official user request? Ability to add material to solids after its creation or even better, ability to specify material for DirectShape GeometryObjects. Either would have been highly desired in the context of what I am working on. 

Thank you,

0 Likes
Message 4 of 6

Revitalizer
Advisor
Advisor

Hello Jaime,

 

in addition to Konrad's reply,

 

it would be fine if we could drive the Materials of a DirectShape or its faces by FamilyParameters.

 

 

Best regards,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 5 of 6

rosalesduquej
Alumni
Alumni
Accepted solution

Hi Konrad & Revitalizer,

 

I found another forum post where similar functionality gets asked. 

http://forums.autodesk.com/t5/revit-api/visible-and-material-parameters-of-a-directshape-in-a-family...

 

I also found the Wishlist request in our system and I have added both of your comments to get the ball rolling. 

The wishlist record is CF-3073 for your record.



Jaime Rosales D.
Sr. Developer Consultant
Twitter | AEC ADN DevBlog
Message 6 of 6

Ning_Zhou
Advocate
Advocate

hi Jaime, how to use Paint() to add the material to an existing solid?

http://forums.autodesk.com/t5/revit-api-forum/assign-material-to-directshape-via-paint/td-p/6709367

0 Likes