Material reference

Material reference

Anonymous
Not applicable
425 Views
3 Replies
Message 1 of 4

Material reference

Anonymous
Not applicable

Hi reviteers,

 

 

There are 7 types ofExternalFileReferenceTypes.

 

I am using this code to retrieve references in a revit project:

ICollection<ElementId> externalReferences = transData.GetAllExternalFileReferenceIds();

 

I can retrieve:

 

ExternalFileReferenceType.AssemblyCodeTable

ExternalFileReferenceType.CADLink

ExternalFileReferenceType.RevitLink

ExternalFileReferenceType.KeynoteTable

 

but there is also a

ExternalFileReferenceType.Material

 

But the code above never gets materials ??

 

What is this setting for ? Is it supposed to retrieve the rendermaterials ? And if so, why doesn't the code above retrieve them ??

 

Is the a way to get a list of missing materials and fix the links ?

0 Likes
426 Views
3 Replies
Replies (3)
Message 2 of 4

JimJia
Alumni
Alumni

The materials are not included as ExternalFileReferences after Revit2012. So you cannot get anything by ExternalFileReferenceType.Material.


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

Anonymous
Not applicable

okay, but is there any other way to get to the material locations ?

I made a tool to fix missing links and it works perfect for keynotes, assembly codes ect. but not for custom loaded materials.

 

 

0 Likes
Message 4 of 4

JimJia
Alumni
Alumni

As far as I know, there is no API support for getting customized material location.

 

But if you want to get the installed material location, you can use the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Autodesk\ADSKAssetLibrary\2017" and the Key Name "LibraryPaths" to retrieval the installed material library location.

 

Hope that can help you.


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