Here is a small AutoLISP program I did a while ago. It's freeware so just grab it, use it, change it or contact me if you want something else to be done.
It makes use of the FIELD functionality in AutoCAD but makes this specific operation easy and quick.
Run the command AT and select a polyline and then where to place the text.
The result is in SQ. FT. but the AutoLISP code can easily be changed for other formats.
When the polyline is changed the area is updated
Restored comments
ReplyDeleteMathew said...
ya its very usful lisp.But AT is unknown command
November 27, 2007
JTB World said...
Have you loaded the file appropriately? It should be a known command. What steps did you use to load the file and what AutoCAD based product and version do you have?
November 27, 2007
luk said...
hi. is it supposed to change automatically, when i change the polyline? you write that it should but it doesnt ... i have to update the FIELD manually
April 09, 2008
JTB World said...
I was not complete in my description. Fields updates based on the setting in FIELDEVAL. For example using Regen. The command UPDATEFIELD can also be used.
April 09, 2008
luk said...
yep works great, thank you very much ... i have a question about AREAM command: the result is always e.g. 1.5016e+009 is it possible to change it that it would be 1501.6e+006 ... so it would be always e+006 >> for me it means that it is square meters when I draw in milimiteres ... tnhak you
April 11, 2008
JTB World said...
1501.6e+06 format would be possibly but it's not a standard format. If you would like me to do it as a customization contact me directly. Otherwise if you could do with having it show up as 1501.6 change the line in the end of the code
(princ tot_area)
to
(princ (rtos (/ tot_area 1000000.0) 2 5))
April 11, 2008
luk said...
thats exactly what i needed :) thank you
April 11, 2008
Karl said...
Very useful. How do you remove the "text mask" behind the inserted text from the routine?
May 21, 2008
JTB World said...
Use FIELDDISPLAY and set it to 0 if you don't want to see the gray background on the field.
May 24, 2008
hi how can i modify the text prop.
ReplyDeleteit is very small
thank you
wal_dab, you can use TEXTSIZE to set the text height before running the command.
ReplyDeleteIt does not work with Autocad 2009,
ReplyDeleteI only get ####.
Jonathan,
ReplyDeleteI have run it both in AutoCAD 2009 and AutoCAD 2010 with success. Not sure what your problem is. If you want you can email me (info@jtbworld.com) a simple drawing where you draw a polyline and run the AT command on it.
why is it that when i used it in layout it does not work... the text area doesn't appear...hope you can help me.thank you
ReplyDeletewhy it doesnt work in lay out....
ReplyDeletedokies, it was never made to work in paperspace but I have now made an update so it does also work in paperspace
ReplyDeletethank you it works know in the layout..but Ive got another problem,when im using it in a scale 1:1000 dwg.,when i picked point in where i would want the text to be,it goes somewhere else,so i have to zoom and find it.can you please help me again to this one...tnx again
ReplyDeleteTEXTSIZE can be used to set the text height
ReplyDeletei don't have problem with the text height...my problem is that when i designate the text were i want it to be it doesn't stick there.. it goes afar from it...
ReplyDeleteNot sure what it can be other than that you snap to something unintentionally. Can this be reproduced on an empty drawing where you just add a new polyline?
ReplyDeletei got it.. it has something to do with my ucs setting....thank you very much for the time and effort that you've given to me to answer my question... i really appreciate it.. tnx again and more power to this site.
ReplyDeleteI have the same problem as Jonathan! I get "####" for an output? I am using Autocad 2008 and 2010 at work and it happened on both platforms. However, I have Autocad 2008 at home and it worked fine? So I think it's a variable or something? Here is the message I got at work when I applied it and I got the "####" characters:
ReplyDeleteCommand: at
Select object: Select point: VLA-OBJECT IAcadMText 000000003bd4c098
I emailed as you directed Jonathan. Hope you figure this out, I could really use it. Thanks
Unfortunately I was not able to identify this issue.
ReplyDeletethanks. the lisp and the clarification on other comments really helps!
ReplyDeletehow can I make it calculate as m2
ReplyDeletethanks
Batros
See it explained here to get it in metric (square meters): Customize areatext.lsp
ReplyDelete