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

The second snippet of code is a procedure. Whenever you use functions or procedures in iLogic, a primary procedure must be created called Main. Any code you would normally place directly into the rule would be placed inside the Main procedure. Replace the first snippet of code with below.

 

Also, make sure you replace "R14400" with the name of the part you want to change color.

 

Sub Main()
Dim asmDoc As AssemblyDocument
asmDoc = ThisApplication.ActiveDocument

' set color for the standard screws
Call SetColor(asmDoc.ComponentDefinition.Occurrences,"R14400","Zinc")SyntaxEditor Code Snippet
End Sub