Assignig values to materials assets

Anonymous

Assignig values to materials assets

Anonymous
Not applicable

Hello guys,

 

Im looking for a way to assign value to the assets of a material created by myself via API, any solutions? I will attach a picture of what I mean in order to make my explanation a bit more clear. I want to fill the text boxes with API.

 

Regards

 

JMGP

AssetsSS.JPG

0 Likes
Reply
Accepted solutions (1)
503 Views
3 Replies
Replies (3)

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @Anonymous,

Try using the below code

ElementId materialId = Material.Create(doc, "Material Name");
                Material mat = doc.GetElement(materialId) as Material;
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_COST).SetValueString("Cost value");
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_DESCRIPTION).Set("DESCRIPTION");
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_INSTANCE_COMMENTS).Set("COMMENTSSS");
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_MANUFACTURER).Set("MANUFACTURER NAME");
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_MARK).Set("MARK NAME");
                mat.get_Parameter(BuiltInParameter.ALL_MODEL_URL).Set("URL AS STRING");

If this helped solve your problem please mark it as solution, so other users can get this solutions as wellSmiley Happy


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes

Anonymous
Not applicable

Thanks for the answer @naveen.kumar.t is there any other class to assign a value to the properties of the other assets? Like the "Graphics" asset and "Physical". I know that the last package released for the "Appearance" asset and I found the one for the "Thermal" already.

 

Any information that is useful for this topic?

 

Regards,

 

JMGP

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support

hi @Anonymous ,

try using the below link

material-assets-appearance-structural-physical-amp


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes