Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Autodesk Inventor Professional 2025
Autodesk Vault Professional 2025
Solved! Go to Solution.