VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Search in proximity of block

1 REPLY 1
Reply
Message 1 of 2
r.ene
347 Views, 1 Reply

Search in proximity of block

I have been breaking my head on how to go about the following challange: I have a layer with certain blocks. On another layer there are text objects always close to the mentioned blocks. I need to find the text directly in vicinity of the objects (can be verified with regexes) and add this text as an attibute to this block. Greatful for any assisance
1 REPLY 1
Message 2 of 2
DavidTosh
in reply to: r.ene

With a similar goal, I've used the following steps:

 - create a bounding polygon for the block. (try to use a rectangle if possible.)

 - expand the bounding polygon to enclose the related text.

 - use the polygon for a window-limited selection set.

 - add, if useful, filters in the selection set for the text's layer and for the text object type.

 - iterate through the items in the selection set, qualifying the text with your regex - if needed.

 

Your success will depend on the uniformity of your drafting conventions. (How "directly in the vicinity" the text actually is.)

 

---
Tosh

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost