Revit API 2014+ Why so dififcult to get Image attached to Material?

Revit API 2014+ Why so dififcult to get Image attached to Material?

Anonymous
399 Views
0 Replies
Message 1 of 1

Revit API 2014+ Why so dififcult to get Image attached to Material?

Anonymous
Not applicable

From a Material, I can obtain the AppearanceAssetElement, and then get the Asset, if null override it with the correctly named one from system assets, and then parse through the list of AssetProperties to determine name, type, value etc.

 

I can even find the XML files that contain the UI definitions for each of the appearance panels, and the corresponding property names and control types displayed.

 

So why the hell can't I get the image attached to a Material?

 

For example, for a "Concrete" material, in the ConcreteUI.xml I see the following :-

 

      <MappableColor id="concrete_color"
                     label="Color"
                     colorbyobject="true"
                     tooltip="Selects a color, image, or procedural texture to create the appearance of the material.">
        <BoolColorByObject id="concrete_color_by_object" />
      </MappableColor>

 

And indeed for a Material that uses this UI file, I can see in the list of AssetProperties a key/value pair named "concrete_color".

 

However, from the Materials manager, that Color selection has an arrow to the right side, which allows to select instead an Image or a Pattern.

 

But even after saving, the list of AssetProperties does not show anything to reflect if that AppearanceAsset is using a Color / Image / Pattern, nor the source of any Image file used.

 

Why doesn't the API expose ALL the properties of an Appearance Asset? How the hell are we supposed to write plugins / addons when half the properties are not even exposed by the API?

 

All I'm trying to do is export the Material properties so I can use them in a 3rd party application. But I have no way of determining if a Material is supposed to be rendered using a Color or an Image or a Texture, and no info on what the source of that Image is.

 

Am I missing something glaringly obvious here, or is this API just useless for all practical purposes?

 

I'm working with the 2014 DLL set, as we're trying to offer backward compat to that version.

0 Likes
400 Views
0 Replies
Replies (0)