[Search tip detail and code files using keywords, tip number, author name, etc ]
 
    For tip to function correctly, you must ensure that the downloaded file name matches the file name
    displayed in the Rename File To field. Please rename downloaded files when necessary.
Polyline Area Labels
Tip# 3548 By Peter Goern On 20-Dec-2010
3.333335
Rated By 3 users Downloaded : 2114
Categories : Single-Line Text, Area
Software type : AutoCAD 2011
Rename File To : P-Area.lsp
Create polyline labels that automatically update when the polyline changes size.

P-Area is a routine to assist you in labeling the area of polylines in AutoCAD. Many people have labeled polylines the traditional way, but what happens when the polyline changes? You have to relabel the polyline again, right? Well, Peter Goern has taken this idea one step further and uses fields in the label that are linked to the polyline. This means if a polyline changes size, the field updates automatically depending on the value of the FieldEval system variable. This saves you from having to relabel the polylines. To use this routine, load it and type in the command P-Area. Keep in mind that the numerical value of the label is linked to the actual area of the entity, but the textual part of the label is defined in the LISP code. Also note that Peter's code creates labels that say "square meters." If your drawing is in inches, feet, miles, kilometers, or any unit other than meters, you will need to adjust the code accordingly. Lastly, this routine only works with LWPolyline entities. You can convert "heavy" polylines using the ConvertPoly command.   

 

Average Rating:
3.333335


User comments
Comment by Lloreda,M Juliana
Posted on 2012-07-23 14:09:09
Wow this is amazing, thank! I had to change the code for square feet, which is pretty simple. It's attached. It's too bad AutoCAD doesn't have this feature built in.
Comment by Briedis,Uogieninas
Posted on 2013-12-12 06:48:52
I don't know why, but I only get label text "####". Why it is so?


Log In