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

I'll do what I can, but all this is much, much easier if you provide a copy of your assembly file.

 

Open your assembly fresh, delete the previous troublesome rules, and go to your iLogic browser. click the far-right tab "External Rules", and right-click "Manually Added", then select "Create New External Rule". Navigate to the directory where you want the external rule saved. Name the first rule "DescriptionEditor". Paste in the following:

 

 

SyntaxEditor Code Snippet

TempString = iProperties.Value("Project", "Part Number")
iProperties.Value("Project", "Description") = TempString
iProperties.Value("Project", "Part Number") = ""

Now create another external rule, save it in the same directory, and call it "ChangeDescription". Paste in the following:

 

SyntaxEditor Code Snippet

oCompDef = ThisDoc.Document.ComponentDefinition
oAssyOccurrences  = ThisDoc.Document.ComponentDefinition.Occurrences

iLogicVb.RunRule("Test")

Dim oOccurrence As ComponentOccurrence

For Each oOccurrence In oAssyOccurrences
    If oSubOccurrence1.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
          iLogicVb.RunExternalRule("ChangeDescription")
    End If
Next

 Now go to your "Manage" tab at the top, and look in the iLogic section of the ribbon. Click "Event Triggers". Make sure the top-left box (Run these rules when events occur) is checked. Highlight "Before Save Document" and click the "Select Rules..." button at the bottom. Check the box beside the line that ends in "ChangeDescription" and click OK.

 

Now that all of that is done, when you save your file, the iProperty "Description" should be the previous part number, and "Part Number" should be blank.