Page 1 of 1

VBA, entity selection

Posted: Wed Oct 26, 2005 3:02 am
by Paul Wertz
Hello !
I have drawing with a set of closed polylines and within each of this closed polylines a text string. I've already wrote sub for text string selection and then, I'd like to be able to select automatically the polyline which enclose this text, so I could then hatch the polylines corresponding to the selected strings. How can I find each closed polyline related to the choosen string and add it to a selection set ?

Thank you very much for any help or suggestion concerning this question.

Posted: Sat Oct 29, 2005 12:05 pm
by John Finlay
Paul Wertz,

I would create a selection set all polylines that have been closed.

Loop through this selection set:

Obtain the x and y co-ordinates for both bounding box points of the first polyline.

Loop through your text selection set and check if the insertion point x and y values fall within the max/min x and y points of the polyline.

If True you can create the hatch and remove the text from the selection set.

Continue to loop through each polyline until complete.

There are many ways to do this and this is only one way; I could think of many more.

------------------
Regards
John Finlay