Element created from solid lost material property in family document

Element created from solid lost material property in family document

Anonymous
Not applicable
729 Views
4 Replies
Message 1 of 5

Element created from solid lost material property in family document

Anonymous
Not applicable
Hi everyone, I created a solid using the following code: SolidOptions options = new SolidOptions(material.Id, ElementId.InvalidElementId); Solid solid = GeometryCreationUtilities.CreateSweptBlendGeometry(pathCurve, pathParams, profileLoops, vertexPairs, options); If I create a DirectShape element using the solid in a project document, the DirectShape element has correct material appearance. But if I create the DirectShape element in a family document, the element just shows grey color and does not have any material appearance. I also tried creating a FreeFormElement using the solid in a family document, and got the same problem, no material appearance. I noticed in the properties browser that the material property is “By Category”. Could anyone please help me on this? How to give the element correct material appearance in the family document? Thanks,
0 Likes
Accepted solutions (1)
730 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk

First of all, find out how to achieve what you wish manually in the user interface. Then, use RevitLookup and other tools to explore the family document database to see how that is represented in the elements and their properties. Once you have that clarified, start working on your programming task:

 

https://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-onto...

 

There is a rather a large number of possible ways to define a material on an element:

 

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

 



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

0 Likes
Message 3 of 5

Revitalizer
Advisor
Advisor

Hi Jeremy,

 

you cannot create a DirectShape in the user interface, so the usual way cannot be gone.

 

 

Rudi




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 4 of 5

Revitalizer
Advisor
Advisor
Accepted solution

Hi,

 

can you set the FreeFormElement's BuiltInParameter.MATERIAL_ID_PARAM?

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 5 of 5

Anonymous
Not applicable

 It seems that the material assigned to the solid is not passed to the FreeFormElement. But the BuiltInParameter.MATERIAL_ID_PARAM can do it. Thanks.

0 Likes