Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
b.slootenMHLJY
163 Views, 2 Replies

Error in code while running Event Triggers

Good day,

 

Since we migrated from Inventor 2018 to Inventor 2023 I get a strange error.

The bit of code shown a bit more down runs with the iLogic Event Trigger when the drawing is opened.

In 2018 all was fine but now I get the following error:

Error.jpg

 

The strange thing is is that the code runs perfectly fine when I run it manually....

 

Here is the code I'm running:

It looks up some values in the revision table and then puts it in some custom iProperties.

 

'xxx
'xxx
'xxx


	' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    ' Set a reference to the first revision table on the active sheet.
    ' This assumes that a revision table is on the active sheet.
    Dim oRevTable As RevisionTable
    oRevTable = oDrawDoc.ActiveSheet.RevisionTables.Item(1)

	    ' Iterate through the contents of the revision table.
	    Dim Rij As Long
	    For Rij = 1 To oRevTable.RevisionTableRows.Count
	        ' Get the current row.
	        Dim oRow As RevisionTableRow
	        oRow = oRevTable.RevisionTableRows.Item(Rij)

	    ' Iterate through column 2 in the row.
	    Dim Kolom As Long
	    For Kolom = 2 To 2'oRevTable.RevisionTableColumns.Count
			
	        ' Get the current cell.
	        Dim oCell As RevisionTableCell
	        oCell = oRow.Item(Kolom)
			
		
            ' Display the value of the current cell
			' MsgBox("Row: " & Rij & ", Column: " & oRevTable.RevisionTableColumns.Item(Kolom).Title & " = " & oCell.Text)
			
		' Write value of current cell to the following iProperties
		iProperties.Value("Custom", "NL_META_UITGAVE") = oCell.Text
		iProperties.Value("Custom", "NL_META_CONTROL_DATUM") = oCell.Text
        
		Next
		
    Next

 

I hope some of you can enlighten me where this goes wrong.