ilogic rule error in assembly

ilogic rule error in assembly

mario170979
Advocate Advocate
459 Views
1 Reply
Message 1 of 2

ilogic rule error in assembly

mario170979
Advocate
Advocate

Hello,

i have a ilogic rule which cleans up our parts. Works fine when a part is the active document. To start the rule i set up a event trigger "Parts" - "Before Save Document" .. 

 

In one case it runs in problems: When i work in a assembly and use the "Save and Replace" Command than Inventor save the file and the rule get triggered. 

I think the error comes from first lines which not working in a assembly: 

 

Dim oDoc As PartDocument = ThisDoc.Document 'Define oDoc as Partdocumenttype to get the functions for this 

If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'check that the Document is a Sheetmetal Part

Dim oDef As SheetMetalComponentDefinition = oDoc.ComponentDefinition 'Define oDef as SheetMetal..Defination to get the data 
Dim oBodies As SurfaceBodies = oDef.SurfaceBodies 
If oBodies.Count > 1 Then 

So i know one solution: i check in the rule that it is a Part Document at first and if not than the rule should stop. 

But i would prefer a way that the rule runs. For this i dont know how i can modificate the code that it works. 

MR
Autodesk Inventor Professional 2025
Autodesk Vault Professional 2025
0 Likes
Accepted solutions (1)
460 Views
1 Reply
Reply (1)
Message 2 of 2

bradeneuropeArthur
Mentor
Mentor
Accepted solution

Use a

Try

 

Catch exception

 

End try

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