Label PLINE at every 500' with object property / data table entry

Label PLINE at every 500' with object property / data table entry

cherrygate
Enthusiast Enthusiast
846 Views
8 Replies
Message 1 of 9

Label PLINE at every 500' with object property / data table entry

cherrygate
Enthusiast
Enthusiast

I am trying to find a script to label all selected PLINEs with a custom object property every X length units (I imported a shapefile and had it make a data table) along the line like the example below.  I have also attached a DWG with the example of a line/data I wanted to label since I am not 100% sure on the correct lingo of what I am asking for. Any help would be appreciated, thank you.

 

cherrygate_0-1615834259804.png

 

 

0 Likes
Accepted solutions (1)
847 Views
8 Replies
Replies (8)
Message 2 of 9

JBerns
Advisor
Advisor

@cherrygate,

 

How many custom objects do you need to label?

 

You could create a block consisting of the road name. Then, use the MEASURE command with the Block option. Use the alignment option and specify the distance. Where you pick on the object is the end from which it is measured.

 

You may need to adjust some of the text object rotation values depending upon the road curvature.

 

If you have a lot of objects/drawings to complete, perhaps some automation (AutoLISP, Visual LISP, etc) could be helpful. If you have a small number of objects to label, perhaps MEASURE will be sufficient.

 

TIP: For the block, set the text justification to bottom-center. For the block base point, choose a point below the text so that it is offset from the object as it is measured.

 

We look forward to your reply. 

 

 

Regards,

Jerry

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

cherrygate
Enthusiast
Enthusiast

Unfortunately it is a large number of items I have to label so I was hoping for something a bit more streamlined/easier to accomplish with a large number of labels to be placed 

0 Likes
Message 4 of 9

CADaSchtroumpf
Advisor
Advisor
Accepted solution

Hi,

Your dwg is provides by autocad map and have object data, I can propose this

 

Message 5 of 9

cherrygate
Enthusiast
Enthusiast

Thank you again for another great script @CADaSchtroumpf 

0 Likes
Message 6 of 9

cherrygate
Enthusiast
Enthusiast

Could you show me how I would modify the script to automatically select the "STREET" property so I do not have to click it everytime? Thank you

0 Likes
Message 7 of 9

J_Spurgeon
Enthusiast
Enthusiast

@CADaSchtroumpf wrote:

Hi,

Your dwg is provides by autocad map and have object data, I can propose this

 


This works great, thank you! Do you know how I could make it where the user selects which side of the line the label is placed?

0 Likes
Message 8 of 9

CADaSchtroumpf
Advisor
Advisor

@J_Spurgeon  a écrit :

This works great, thank you! Do you know how I could make it where the user selects which side of the line the label is placed?


You can try change the line 168

(subst (cons 10 (polar pt (+ rtx (* pi 0.5)) (getvar "TEXTSIZE"))) (assoc 10 dxf_ent) dxf_ent)

by

(subst (cons 10 (polar pt (angle pt (trans (cadr tmp) 1 0)) (getvar "TEXTSIZE"))) (assoc 10 dxf_ent) dxf_ent)

Move the cursor from side to side to place the text on the desired side.

Message 9 of 9

J_Spurgeon
Enthusiast
Enthusiast

@CADaSchtroumpf wrote:

@J_Spurgeon  a écrit :

This works great, thank you! Do you know how I could make it where the user selects which side of the line the label is placed?


You can try change the line 168

 

(subst (cons 10 (polar pt (+ rtx (* pi 0.5)) (getvar "TEXTSIZE"))) (assoc 10 dxf_ent) dxf_ent)

 

by

 

(subst (cons 10 (polar pt (angle pt (trans (cadr tmp) 1 0)) (getvar "TEXTSIZE"))) (assoc 10 dxf_ent) dxf_ent)

 

Move the cursor from side to side to place the text on the desired side.


That worked perfect, I appreciate it!

0 Likes