• Home
  • Training Books
  • Subscribe to Our Email Newsletter
  • About
    • Contributors
    • Feedback
    • Contact
    • Privacy policy
    • Cookie Policy

CADnotes

CAD Tutorials and Best Practices for professionals and students

  • Featured
  • AutoCAD
    • AutoLISP
  • Revit
    • Revit Architecture Basic
    • Revit MEP Basic Tutorial
  • Inventor
  • MicroStation
    • MicroStation Basic Tutorial
You are here: Home / AutoCAD / Labeling Coordinate with Easting and Northing in AutoCAD

Labeling Coordinate with Easting and Northing in AutoCAD

November 26, 2010 by Edwin Prakoso 15 Comments

After I provided AutoLISP program to label coordinate automatically, I had some questions if it can show N, E, and elevation instead of just the coordinate text. So I made minor adjustment to the code.

This automatic labeling will create three lines of texts instead of just one line of xyz coordinate.

NE_labeling

You can open notepad, copy and paste the code below, then save it as “lb.lsp” (type it with double quote when saving in notepad). If you want to show only Easting and Northing, you can delete the marked lines. Or replace East with E or X=, and so on.

You can read our tip on how to load AutoLISP program.

I hope this is useful.

; Automatic coordinate labeling
; Edwin Prakoso
; https://www.cad-notes.com
;
; Limitation
; ----------
; Will use current leader style and current units setting
; If you don't want to show elevation, then modify lines marked *

 

(defun c:lb (/ p x y z ptcoord textloc)
(while
(setq p (getpoint "
Pick Point: "))
(setq textloc (getpoint "
Pick Label Location: "))
(setq x (rtos (car p)))
(setq y (rtos (cadr p)))
(setq z (rtos (caddr p))) ;*you may delete this line
(setq x (strcat "East " x))
(setq y (strcat "North " y))
(setq z (strcat "Elev. " z)) ;*you may delete this line
(command "_LEADER" p textloc "" x y z "") ;*you may delete z
)
)

Want to create this program by your own? You can also adjust it to your needs. Try this AutoLISP exercise to create labeling coordinate program here.

About Edwin Prakoso

I work as a Sr. Consultant in PT Cipta Satria Informatika. I've been using AutoCAD since R14 and Revit since Revit Building 9. I occasionally write for AUGIWorld magazine and I am also active in Autodesk discussion forum. I'm a member of Autodesk Expert Elite, an appreciation for individuals who give contributions to the Autodesk community.
Connect with me on twitter or LinkedIn.

Filed Under: AutoCAD, AutoLISP Tagged With: autolisp, label coordinate

0 0 votes
Article Rating
Subscribe
Login
Notify of
guest

guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

15 Comments
Inline Feedbacks
View all comments
Adit
Adit
7 years ago

thank you master, I little bit modify your routine to get Y value for manual cross section
but how to change the leader became point or node?. and make the text vertical. btw thank you sir

(defun c:lb (/ p x y ptcoord textloc)
(while
(setq p (getpoint “\nPick Point: “))
(setq textloc (getpoint “\nPick Label Location: “))
(setq y (rtos (cadr p)))
(setq ptcoord (strcat y))
(command “_LEADER” p textloc “” ptcoord “”)
)
)

0
Reply
Ganesh
Ganesh
9 years ago

which command will type in command list then XY coordinates will be showing in the darawing

0
Reply
mohammed azmatullah
mohammed azmatullah
11 years ago

hello im a beginner to lisp ,campus student.this is what i need.i need a lisp code (program) to get every coordinate of points in specific layer to a notepad.i know it can be done but my knowledge is at very basic .So pls send me a code with comments that explain complex codes. im requirement is to learn that kind of lisp program not only to use it.So if U can please help me with this . sir idont know how do give coordinates from cadd to excel please hlep me sir

0
Reply
Sandy Villamar
Sandy Villamar
12 years ago

Hi, i would like to ask if it is possible to remove the leader, i just wanted to make it just the mtext with coordinates. Thanks!

0
Reply
Artur Araujo
Artur Araujo
12 years ago

Amigo, muito obrigado, salvaste meu dia!!!! Feliz Natal!!!!

0
Reply
Prasanna Hemantha
Prasanna Hemantha
13 years ago

hello im a beginner to lisp ,campus student.this is what i need.i need a lisp code (program) to get every coordinate of points in specific layer to a notepad.i know it can be done but my knowledge is at very basic .So pls send me a code with comments that explain complex codes. im requirement is to learn that kind of lisp program not only to use it.So if U can please help me with this

0
Reply
Saqib
Saqib
13 years ago

Hi Edwin Prakoso,
         How are you, this was a useful lisp,  but I need a lisp which labels texts of offset and elevation of different points of a polyline and should ask the point to  where text will be labeled. If you have such a lisp please provide.Thanks…

0
Reply
Edwin Prakoso
Edwin Prakoso
Reply to  Saqib
13 years ago

Can you describe what you want to achieve? A sample drawing perhaps? This LISP should do similar thing, only need minor adjustment.

0
Reply
Al Bdour
Al Bdour
13 years ago

hi why does this routine show nil after existing ??

(defun c:lpo (/ a p yvalue p1 )
  (setq a 0.0)
  (setq p (getpoint"n New Origin Point: "))
  (setq yvalue (getreal"n New Yvalue: "))
  (command "_.ucs" "o" p )
  (setq p1 (list a (* -1 yvalue) a ))
  (command "_.ucs" "o" p1 )
  princ()
)

0
Reply
Edwin Prakoso
Edwin Prakoso
Reply to  Al Bdour
13 years ago

You should use (princ) not princ() at the last line.
Try to change it and reload the AutoLISP. It should fix it.

0
Reply
djmayehem
djmayehem
14 years ago

Yes I am saving and reloading after every change. I will send you the file, it would be great if you could figure out what the issue is.

Thank you

0
Reply
djmayehem
djmayehem
14 years ago

Hi,

I really like the three different lines feature of this code.

I am trying to have the coordinates appear in N,E,Z format instead of E,N,Z. I have tried rearranging the code but it seems to not work for me.

Also when I change the command to anything but 'lb' it loads fine but does not work once loaded in AutoCAD (even when I change it back to lb, it seems any changes to the command make it not work properly).

Any ideas here?

0
Reply
Edwin Prakoso
Edwin Prakoso
Author
Reply to  djmayehem
14 years ago

Have you tried to reload the LISP program? You need to save it and reload it after you make changes.
If you have, email me your code so I can take a look.

0
Reply
VHON olibay
VHON olibay
Reply to  Edwin Prakoso
7 years ago

Sir, Can u teach me how to use lisp in uatocad 2017? TIA
This is my email: vhon.seapine@Gmail.com

0
Reply
1 2 Next »
wpdiscuz   wpDiscuz

Featured

Setting Up AutoCAD Sun Light is Easy!

Do you think setting up lighting for your AutoCAD rendering is difficult? try this tutorial to easily get compelling result!

Recent Articles

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available

Advertisement

New on CADnotes

  • Autodesk Construction Cloud Activity Log
  • Exporting AutoCAD Plant 3D Model to Navisworks
  • Autodesk Data Connector for Power BI is Now Available
  • Autodesk Forma Design Contest
  • Revit 2025: Toposolid Enhancements

Meet the Authors

avatar for
avatar for
avatar for
avatar for
avatar for
avatar for

Get Connected

CADnotes on FacebookCADnotes on InstagramCADnotes on TwitterCADnotes on YouTube

© 2009 – 2025 CADnotes · Feedback · Privacy Policy · Become an affiliate

wpDiscuz