10-31-2024
06:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-31-2024
06:21 AM
You can use the RangeBox property of a part feature, and then check if they are overlapping using "IsDisjoint". See code below. Be careful with this method though, as if the hole is COMPLETELY overlapped it will return "Nothing" for its rangebox and then you cant use .isDisjoint. I added in some checking for this, but its something to be aware of.
Dim oPart As PartDocument = ThisDoc.Document For Each oFeature As PartFeature In oPart.ComponentDefinition.Features.HoleFeatures If oFeature.RangeBox Is Nothing Then Continue For For Each oFeatureOther As PartFeature In oPart.ComponentDefinition.Features.HoleFeatures If oFeatureOther IsNot oFeature And oFeatureOther.RangeBox IsNot Nothing If Not oFeature.RangeBox.IsDisjoint(oFeatureOther.RangeBox) Then Logger.Info("OVERLAPPING: " & oFeature.Name) End If Next Next