Dear All,
How to get the nearest Polygons which contains the selected elements (using VBA)?
In the attached screenshot, the Majenta color represents the selected elements and the corresponding nearest polygons was represented in Green color.
Unknown said:How to get the nearest polygons which contains the selected elements?
Regards, Jon Summers LA Solutions
Thanks Jon.
I followed your suggestion with a slight change as given below(since the selected elements are polygon. we can use them as fence).
CadInputQueue.SendKeyin "CHANGE VIEW CUSTOM ""Smooth"" 1"
''now create a fence - Type = Element,Mode = Overlap
createPolygonasFence selectedElemnt
Set elemntEnumerator = ActiveDesignFile.Fence.GetContents
While elemntEnumerator.MoveNext
Set fEl = elemntEnumerator.Current
If fEl.ID.Low <> selectedElemnt.ID.Low Then And fEl.IsShapeElement Then
''other statements
End If
Wend
Unknown said: If fEl.ID.Low <> selectedElemnt.ID.Low
Don't use that test; you're considering only half the element ID. Prefer to use this...
If 0 = DLongComp (fEl.ID, selectedElement.ID)
Thank You :)