Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assignig values to materials assets

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
500 Views, 3 Replies

Assignig values to materials assets

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

3 REPLIES 3
Message 2 of 4
naveen.kumar.t
in reply to: Anonymous

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

Message 3 of 4
Anonymous
in reply to: naveen.kumar.t

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

Message 4 of 4
naveen.kumar.t
in reply to: Anonymous

hi @Anonymous ,

try using the below link

material-assets-appearance-structural-physical-amp


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report