Writing material to iProperties

Writing material to iProperties

Anonymous
Not applicable
656 Views
4 Replies
Message 1 of 5

Writing material to iProperties

Anonymous
Not applicable

Good day everyone,
I have a rule .... iProperties.PartColor, and thanks to it, my color is automatically written to iProperties. I can't figure out what to replace .PartColor, I was writing material. Thanks

0 Likes
Accepted solutions (1)
657 Views
4 Replies
Replies (4)
Message 2 of 5

JhoelForshav
Mentor
Mentor

Hi @Anonymous 

 

Part document objects have the property ActiveMaterial.

Try this ilogic rule in a part document to get the name of the material.

I assume you already know how to create and add values to properties? 🙂

 

Dim oDoc As PartDocument = ThisDoc.Document
Dim oMaterialName As String = oDoc.ActiveMaterial.DisplayName
MsgBox(oMaterialName)

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

I need the material to be written to my iProperties. The whole rule for color is this: 

iProperties.Value("Custom","Povrchová úprava/Dekor")=iProperties.PartColor
0 Likes
Message 4 of 5

JhoelForshav
Mentor
Mentor
Accepted solution
Dim oDoc As PartDocument = ThisDoc.Document
iProperties.Value("Custom", "Material") = oDoc.ActiveMaterial.DisplayName
0 Likes
Message 5 of 5

Anonymous
Not applicable

Thank you very much. You helped me a lot.