Material Browser Category Mapped to iProperties

Material Browser Category Mapped to iProperties

KWarrenCA
Advocate Advocate
189 Views
2 Replies
Message 1 of 3

Material Browser Category Mapped to iProperties

KWarrenCA
Advocate
Advocate

Is there any way to map the category of the material to iProperties' of the part? So we assign the material as 304L but would also like to add the category of Stainless Steel to the iProperties that we can then map to vault for our ERP system. Possible with iLogic?

KWarrenCA_0-1741115703693.png

 

0 Likes
Accepted solutions (1)
190 Views
2 Replies
Replies (2)
Message 2 of 3

J-Camper
Advisor
Advisor
Accepted solution

There is no way to build a truly dynamic link, but this rule will set a custom iProperty whenever it get run.  It can be set to an event trigger, like before save, to trigger it without thinking:

Dim pDoc As PartDocument = TryCast(ThisDoc.Document, PartDocument)
If pDoc Is Nothing Then Exit Sub

Dim mAsset As MaterialAsset = pDoc.ActiveMaterial
Dim PropertyValue As String = mAsset.CategoryName
Dim PropertyName As String = "Material Category Name"
Dim CustomiProperties As PropertySet = pDoc.PropertySets.Item("Inventor User Defined Properties")

Try
	Dim prop As Inventor.Property = CustomiProperties.Item(PropertyName)
	If prop.Value <> PropertyValue Then prop.Value = PropertyValue
Catch
	 CustomiProperties.Add(PropertyValue, PropertyName)
End Try

 

Message 3 of 3

WCrihfield
Mentor
Mentor

And in a PartDocument, we do have the event named "Material Change" in the Event Triggers, which sounds like the perfect trigger to run a rule like that.

WCrihfield_1-1741178012200.png

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)