Select text inside closed polylines and define block atributtes with that text.

Select text inside closed polylines and define block atributtes with that text.

Anonymous
Not applicable
3,594 Views
25 Replies
Message 1 of 26

Select text inside closed polylines and define block atributtes with that text.

Anonymous
Not applicable
I have an floor-plan drawing with several rooms defined by an enclosed polyline. There are several text annotations inside each polyline (room-number, room-name, etc).
How can i make a routine thats scans the drawing, builds a selectionset that finds each polyline (resides on a specific layer) and creates a block (room_stamp) with attributes corresponding to those annotations. 
E.g.: for every room it would insert the block "room_stamp" inside the polyline, grab the text inside the polyline which belongs to the layer "room_name" and change the attribute "room_name" inside the block to match it.

Any help would be apreciated as I am just starting with LISP routines.
0 Likes
3,595 Views
25 Replies
Replies (25)
Message 21 of 26

JBerns
Advisor
Advisor

@Anonymous,

 

I believe I have a rough solution working for your request. See ScreenCast video.

https://autode.sk/3l7zuT0 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 22 of 26

Anonymous
Not applicable

Thanks everybody for the insights and discussion. We've been working a solution with @devitg.

 @JBerns your solution looks good ! Would you mind sharing the LISP routine to see how you did it?

0 Likes
Message 23 of 26

Anonymous
Not applicable

@Anonymous, would you mind sharing your script?

Thanks!

Best regards

0 Likes
Message 24 of 26

JBerns
Advisor
Advisor

@Anonymous,

 

See private response for now.

 

Regards,

Jerry 

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 25 of 26

Anonymous
Not applicable
Hello Jerry, i am looking down on the same problem and can't seem to get the right script for the job. It seems that you have figured it out in this post, any chance to see the script?

Regards,
Andreas
0 Likes
Message 26 of 26

JBerns
Advisor
Advisor

@Anonymous,

 

I have attached the code development as it was presented to @Anonymous .

You will need to adjust block names, layer names, attribute definition names, etc. to suit your need. 

You will need to change your block definition to match the code or edit the code to match your block.

I hope you find this helpful.

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
0 Likes