Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
pball
in reply to: MegaJerk

Thanks for that info MegaJerk, that is exactly what I needed. Below is the code I came up with to check if a part/assembly inside of a drawing has an external rule setup to trigger.

 

Dim docFile As Document
If ThisDoc.ModelDocument IsNot Nothing Then
	docFile = ThisDoc.ModelDocument
Else
	Return
End If

'Check if part has iLogic rule named Material, if not this will update Matrl iProp even if Matrl already exists
Dim MatFound = False
Dim iLogicE As propertyset
iLogicE = docFile.PropertySets.Item("{2C540830-0723-455E-A8E2-891722EB4C3E}")

For i As Integer = 1 To ilogicE.count
	If (InStr(ilogicE.item(i).Value,"Material_Part")) Or (InStr(iLogicE.item(i).Value,"Material_Assembly")) Then MatFound = True
Next

MsgBox("Does part/assembly have a matching external iLogic rule. " & MatFound)
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style