Message 1 of 3
Box.IsDisjoint Method
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to suppress with VBA all occurrences in assembly based on the condition if they intersect a part(cube:1).
I'm using rangeboxes for that and IsDisjoint methond. However nothing works as I expect.
Public Sub CutBox() Dim AssDoc As AssemblyDocument Set AssDoc = ThisApplication.ActiveDocument Dim oAsmCompDef As Inventor.AssemblyComponentDefinition Set oAsmCompDef = AssDoc.ComponentDefinition Dim oOcc As ComponentOccurrence Dim CutBox As Box Set CutBox = AssDoc.ComponentDefinition.Occurrences.ItemByName("Cube:1").Definition.RangeBox For Each oOcc In oAsmCompDef.Occurrences If oOcc.Definition.RangeBox.IsDisjoint(CutBox) = True Then oOcc.Suppress End If Next End Sub
Any idea what's wrong? I'm sure that some occurrences' rangebox do not intersect the cube's part range box, but Inventor doesn't suppress those occurrences.
Regards
Alexandru
Autodesk Inventor 2015 Certified Professional