Exporting Materials from GetRenderingAsset()

Anonymous

Exporting Materials from GetRenderingAsset()

Anonymous
Not applicable

Hi

 

I am able to export Material textures etc for the majority of models using doc.GetElement(material.AppearanceAssetId) as AppearanceAssetElement.

 

 

However,  (as an example) element "Trck_BswySystms_Cooper_RSA_Profile Series_AR1111 Closed Back Integral Xfmr" has geometry for the reflector and lens of the lamp that does not appear to have a material.  I am currently just assigning a white generic material for these parts but it is not satisfactory as it occludes the embedded IES light source.

 

Question:  How do I get the material properties for all geometry?  Are there other properties I should be looking at?

 

Adam

 

 

 

0 Likes
Reply
657 Views
3 Replies
Replies (3)

JimJia
Alumni
Alumni

Dear Adam,

 

You may refer to this page, do you think it solve your request? http://thebuildingcoder.typepad.com/blog/2008/10/element-materials.html

 

Note that some API method is obsolete in latest Revit API, but you can find the latest code from here: http://thebuildingcoder.typepad.com/blog/2016/05/the-building-coder-samples-2017.html


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes

Anonymous
Not applicable

Hi Jim

 

I am using the IExportContext class.

 

What I find during exporting is that when I perform:

 

document.GetElement(materialnode.materialId) as Material

 

I get a null material.  And materialnode.HasOverridenAppearance() is false.

 

I attached a screenshot of the spotlight I am exporting.  It contains an IES light which I correctly export, however the light source is behind some geometry that has no material assigned - so is assigned a default white material that blocks any light!

 

I am presuming that somewhere is some Asset that marks the geometry in front of the IES light source as glass or something transparent.

 

Adam

0 Likes

JimJia
Alumni
Alumni

Dear Adam, 

We checked the document you provided, unfortunately however it is hard to us to find a clue how to recreate this problem. In order to diagnose, could you isolate your test project and send us a small, reproducible sample? Note, please do not send us any information you think are confidential to your company. We appreciate your understanding and your patience again!


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes