Error iLogic Rule by Open Drawing from Vault

Error iLogic Rule by Open Drawing from Vault

petr_suchomel
Explorer Explorer
765 Views
5 Replies
Message 1 of 6

Error iLogic Rule by Open Drawing from Vault

petr_suchomel
Explorer
Explorer

Hello, I created iLogic Rule for update style. The rule I run after open drawing. When I open drawing by command "Open" or from model by "Open drawing" rule run right. When open drawing from model by "Open drawing from Vault" rule crashed.

0 Likes
766 Views
5 Replies
Replies (5)
Message 2 of 6

bradeneuropeArthur
Mentor
Mentor

Could you upload the code as text file?

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 6

petr_suchomel
Explorer
Explorer

OK, here it is.

0 Likes
Message 4 of 6

bradeneuropeArthur
Mentor
Mentor

Try this way:

 

Dim oDoc = ThisDoc.Document
If oDoc.DocumentType <>  DocumentTypeEnum.kDrawingDocumentObject Then
   Exit Sub

else
Dim oDrawDoc As Inventor.DrawingDocument
oDrawDoc = ThisDoc.Document
End If

Dim i As Integer
For i = 1 To oDrawDoc.StylesManager.Styles.Count
    If oDrawDoc.StylesManager.Styles.Item(i).UpToDate  = False Then
		If oDrawDoc.StylesManager.Styles.Item(i).Name = "Výchozí norma (DIN)" Then
			oDrawDoc.StylesManager.Styles.Item(i).UpdateFromGlobal
				MsgBox("Macro OK",,"IdwStylesUpdate")
		End If
    End If
Next i
 

 or better:

Dim oDoc = ThisDoc.Document
If oDoc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then Dim oDrawDoc As Inventor.DrawingDocument oDrawDoc = ThisDoc.Document else exit sub End If Dim i As Integer For i = 1 To oDrawDoc.StylesManager.Styles.Count If oDrawDoc.StylesManager.Styles.Item(i).UpToDate = False Then If oDrawDoc.StylesManager.Styles.Item(i).Name = "Výchozí norma (DIN)" Then oDrawDoc.StylesManager.Styles.Item(i).UpdateFromGlobal MsgBox("Macro OK",,"IdwStylesUpdate") End If End If Next i

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 6

petr_suchomel
Explorer
Explorer

Your rules generate the same error which I sended.

0 Likes
Message 6 of 6

jaco011
Advocate
Advocate

Did you find an solution? I am searching too

0 Likes