In the browser there are suppressed features with sketches, those delete just fine... however there are shared sketches, and features without sketches that disrupt the flow of my rule. With each disruption an error message pops up. I click OK, make no changes to the rule and just click OK all the way through it. If I cycle through the error messages clicking OK all the way through, everything suppressed eventually gets deleted. The rule would work perfectly if no error messages would pop up.
Could someone take a look at my rule, share your thoughts?
*Inventor 2013, Windows 7*
'-------------------------------------------------------------------iLogic Rule Start-------------------------------------------------------------------------------------------
Dim oDoc As Document
Dim oFeature As PartFeature
Dim oFeatures As PartFeatures
Dim oSketch As PlanarSketch
Dim oSketches As PlanarSketches
oDoc = ThisApplication.ActiveDocument
oFeatures = ThisDoc.Document.ComponentDefinition.Features
oSketches = oDoc.ComponentDefinition.Sketches
For Each oSketch In oSketches
If oSketch.Dependents.Count = 0 Then oSketch.Delete
Next
For Each oSketch In oSketches
If oSketch.Dependents.Count = 1 Then oSketch.Delete
Next
For Each oFeature In oFeatures
If Feature.IsActive(oFeature.Name) = False Then oFeature.Delete
Next
'-------------------------------------------------------------------iLogic Rule End-------------------------------------------------------------------------------------------
Solved! Go to Solution.
Solved by jestclair. Go to Solution.
Hi,
Could you attach an ipt file that I can use with your rule to research this?
Thanks,
Wayne
Try Thisapplication.silentoperation =true
at the end of your code, you use Thisapplication.silentoperation =false
Don't forget in the errorhandler to write also there Thisapplication.silentoperation =false
Otherwise working in inventor without messages is a pita!
this code hides any errormessages, or messages to save, etc...