Message 1 of 25
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We do have set of external iLogic rules running automatically on Open and Save Inventor Documents with IDC (Inventor Design Checker).
Some (AFAIK only two particular) IPT oriented rules sometimes produce error "Object Variable or With block Variable Not Set".
Here is a bit simplified code of one:
Try Dim oCompdef As PartComponentDefinition oCompdef = ThisDoc.Document.ComponentDefinition Dim oSketch As Sketch ''' Initial argument values msg = "There were no unused sketches found." retval = 1 For each oSketch in oCompdef.Sketches If oSketch.HealthStatus <> HealthStatusEnum.kBeyondStopNodeHealth And oSketch.Consumed = False Then msg = "There is at least one unused sketch - " & oSketch.Name retval = 0 Exit For End if Next RuleArguments.Arguments.Value("ReturnValue") = retval RuleArguments.Arguments.Value("Description") = msg Catch End Try Trace.WriteLine (retval & "; " & msg)
The Error occurs occasionally. I see no relation to particular IPTs. Sometimes it even happens on creating new IPT. Sometimes Inventor reboot helps.
How could I debug such occasional errors?
Please vote for Inventor-Idea Text Search within Option Names
Solved! Go to Solution.