Using Ilogic to Update a Custom Iproperty Depending on a Part's Selected Material

Using Ilogic to Update a Custom Iproperty Depending on a Part's Selected Material

thomass4FBDGA
Explorer Explorer
156 Views
1 Reply
Message 1 of 2

Using Ilogic to Update a Custom Iproperty Depending on a Part's Selected Material

thomass4FBDGA
Explorer
Explorer

I want to update my custom Iproperties to change from yes to no depending on the parts material selected. What script would I use in Ilogic which would read my material selected on a specific part and change multiple "Yes or No" Iproperties within this sketch? 

thomass4FBDGA_0-1736528666884.png

thomass4FBDGA_1-1736528697771.png

 

 

0 Likes
157 Views
1 Reply
Reply (1)
Message 2 of 2

Curtis_Waguespack
Consultant
Consultant

Hi @thomass4FBDGA,

 

Welcome to the forum.

 

This should get you started.

 

Hope that helps,

Curtis

 

Dim oDrawDoc As DrawingDocument = ThisDoc.Document

' Get the first view's model document
Dim oView As DrawingView = oDrawDoc.ActiveSheet.DrawingViews.Item(1)
Dim oModelDoc As Document = oView.ReferencedDocumentDescriptor.ReferencedDocument

If Not TypeOf oModelDoc Is PartDocument Then Exit Sub

' For parts
Dim oPart As PartDocument = oModelDoc

' Get the material name
Dim materialName As String = ""
materialName = oPart.ComponentDefinition.Material.Name

' Update the custom iProperty
If materialName = "" Then Exit Sub

iProperties.Value("Custom", "Engineering Paint Standards 1") = (materialName = "Generic")

 

EESignature

0 Likes