Wednesday, October 10, 2007

AreaText.LSP for AutoCAD

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.

AreaText.LSP

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.

image

When the polyline is changed the area is updated

image

18 comments:

  1. Restored comments

    Mathew 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

    ReplyDelete
  2. hi how can i modify the text prop.
    it is very small
    thank you

    ReplyDelete
  3. wal_dab, you can use TEXTSIZE to set the text height before running the command.

    ReplyDelete
  4. It does not work with Autocad 2009,
    I only get ####.

    ReplyDelete
  5. Jonathan,
    I 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.

    ReplyDelete
  6. 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

    ReplyDelete
  7. why it doesnt work in lay out....

    ReplyDelete
  8. dokies, it was never made to work in paperspace but I have now made an update so it does also work in paperspace

    ReplyDelete
  9. thank 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

    ReplyDelete
  10. TEXTSIZE can be used to set the text height

    ReplyDelete
  11. i 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...

    ReplyDelete
  12. Not 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?

    ReplyDelete
  13. i 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.

    ReplyDelete
  14. I 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:

    Command: 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

    ReplyDelete
  15. Unfortunately I was not able to identify this issue.

    ReplyDelete
  16. thanks. the lisp and the clarification on other comments really helps!

    ReplyDelete
  17. how can I make it calculate as m2
    thanks
    Batros

    ReplyDelete
  18. See it explained here to get it in metric (square meters): Customize areatext.lsp

    ReplyDelete

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.