Revit secondary development-obtain texture maps of materials and Secondary Development of revit

Source: Internet
Author: User
Tags export class

Revit secondary development-obtain texture maps of materials and Secondary Development of revit

The Onmaterial () method in the IExportContext export class can be used to obtain the material information, mainly the material ID. Then, the material object material is obtained based on the material ID, and the Asset object is obtained through the following code:

ElementId appearanceId = material. AppearanceAssetId;
AppearanceAssetElement appearanceElem = document. GetElement (appearanceId) as AppearanceAssetElement;
Asset theAsset = appearanceElem. GetRenderingAsset ();

This Asset object contains all the rendering-related data, including texture maps. Determine the attribute "unifiedbitmap_Bitmap", that is, the desired texture map. to read the specific Asset attribute, you can search for Asset in the Revit API documentation. An example is provided.

 

Note: The texture map Path obtained here is relative to the system texture library path. Currently, you do not know how to obtain the system texture library path through the API provided by Revit: "C: \ Program Files (x86) \ Common Files \ Autodesk Shared \ Materials \ Textures ". If you have any idea, thank you!

 

 

For more information, see the source document. Http://www.cnblogs.com/onlyperfect/p/4235426.html

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.