I had this question several times: can we automatically label our coordinate in AutoCAD? If you are a Civil3D user, then you most likely will suggest them to use C3D. But can AutoCAD do it? YES!
I saw many people use AutoLISP to do that task. It works great. But sometimes you may want to have your labeling symbol and format. So, why not using field?
Creating a reference object
First, we need to create an object as a reference point. It can be a point, a circle, or any symbol you want it to appear. I use this symbol.
I prefer to use point or circle. We can easily use the point position or circle center.
Creating an Attribute Definition
After we have the reference object, we need to define an attribute definition. You can activate it by clicking it on your ribbon, home tab, block panel.
Or simply type ATTDEF then [enter].
Let’s define our attribute. Give the attribute tag, prompt like below. In default field, type ‘X Y = ‘ then click insert field.
Change the field category to objects, and in field names, select object. Click select object button to define the object type. Select the circle, don’t select anything else!
AutoCAD will list all available properties. Select center (or if you use point, select position). Because I only use it in 2D drawings, I don’t need it to display Z value. I turn it off. Change the format if necessary.Click OK.
Click OK again to close the define attribute dialog box. Place your attribute definition in the desired location.
Optional: Define Adjustable Leader
If you don’t want to have a leader on your coordinate label, you can skip this step.
I add a line that will be used as the leader.
Create the Block
Now we can define the block. Click create from ribbon, block panel.
Select all the objects, and define the center as an insertion point. Activate Open in Block Editor on the lower left of this dialog. We are going to add some ‘dynamic’ functionality. Click OK.
AutoCAD will show the edit attribute dialog. We don’t want to modify it as it is updated automatically. Just click OK.
Add the Control Grip
What we want to do is adding a grip control so that we can modify the text (and optionally leader) placement. In block authoring palette, activate the point parameter.
Now place it where you want the grip to appear.
Now activate the stretch action.
Select the point parameter, create the stretch frame like below, and select the line and attribute definition. [Enter] to end it.
Now we are done! Save this block and close block editor.
Using the Label
How can we use the label? Just insert the block, and click on the point you want to show the coordinate. After you have one of the blocks in your drawing, you can copy it and place it on several points you wanted.
Because we add a control grip, we can move the text and leader position!
Because we use a field, if you move your points, the value will be automatically updated! Very cool, isn’t it?
Why Attribute Definition? Why not Just Use Text?
You might ask this: why not just use text in a field? I know we can insert a field into a text, single or multiline. But it doesn’t work. You may want to try it by yourself.
Apparently, the field will consider the reference point always at 0,0,0 when you create a block. It works if you don’t create a block from them, but I believe you want to use it as reusable content, aren’t you?
Video Instruction
If you have problem, you can use this video as reference how to create and use the coordinate label block.
Hi, Edwin, yes acad is very weak in labeling both in xyz of points and bearings and dist in lines. what are the way to fix this short coming?
JR (jr_chia@yahoo.com)
Edwin,
This has been very useful for me but there is one thing I would like to do but can't work out:
My drawing is set up in millimetres and I can't change that for the purposes of how we set our drawings up, but I would like to show the co-ordinates in metres. Is there a way to automatically convert the values?
Unfortunately you can't. If you want to do this, you have to use AutoLISP program. We have AutoLISP program that do similar thing: https://www.cad-notes.com/2010/11/using-autolisp-to-la…
Hi Edwin, Your instruction is great!
I followed your instruction to create a block with coordinate value, it works. I have a situation where about 50 point that I need to label with xy coordinate. I like your method, but I don't want to keep hitting "insert" and "enter" too many times; can I somehow copy this block to the rest of the locations that I want to label and have it display at the right coordinates?
Also, is there an easier way than copy and paste to put this coordinate on the chart after the xy coordinates are label at the right locations?
Thank you in advance.
TN,
Yes, you can copy it. All the blocks will display correct coordinate. But remember, the value only update if you regen, save or print it.
For the second question, you can use data extraction to create a report. Check this article: https://www.cad-notes.com/2009/12/reporting-multiple-c…
Great! I have not checked this one yet but will do.. In the mean time, i attached the coordinate label blocks (discussed above) as an xref to a drawing, it shows fine but when i plot it, the coordinates shows zero values.. i have tried fieldeval but it still shows the same.. do you know why by any chance?.. thanks a lot.
It's the downside of this method. It only works for current file, and only for WCS. If you're working with XREF or UCS coordinate, AutoLISP works better.
This is really helpful for ever changing design, i created 2 attributes for x and y. i added the flip parameter as well as it needs to be on the other side sometimes.. thanks edwin!
Glad that you find it useful ;)
You may also want to consider using AutoLISP program. I wrote this tutorial too, if you want to try it.
Hi Edwin
Your Block works perfectly, but I need your help in getting a label display (i.e) 1,2,3 …. or A, B, C……. in incremental or decremental order with the block when I copy the same block number of time in a same DWG. I need it because when I extract date to excel I get a column which shows 1 or A and the value.
Please advise
Thanks for Understanding
Regards
Afaque,
This require a LISP programming to do that. I will try to create one when I have time. I hope I can publish it this week.
Afaque,
You may want to take a look at this: http://www.contractcaddgroup.com/VBA/renumber/ren…
But you need to download VBA for AutoCAD and install it first to make it work. <a href="http://www.autodesk.com/vba-download” target=”_blank”>www.autodesk.com/vba-download
Love the post. I've created my with 2 attibute definitions to show the Y/X values, stacked. After selecting the object, point and position, I click the "Additional Format". The "Thousands number separator" is grey out. I've like to be able to show the northing/easting as ie. 6,123,123.00 and 423,123.00. Can you help?
Kara,
I think this is another stacking problem. I don't know how you can even make it works. Just like Calum said, all I see is ####.
I think you need to create separate attributes.
Works excellently for single line text but would like to have the X Y and Z coordinates to appear stacked as a multiline text (MTEXT) Have tried selecting field at ATTDEF stage then defining multiline in the same dialog box but ultimate result is single line of '##############' characters???
Look forward to your reply
Calum,
I notice after I tried it. I haven't been able to solve it.
Just curious, why don't you try to create three separate attributes and arrange the position to make them look stacked?
It works, maybe require more works, but I don't think it's a big problem. We only create the block once anyway…
I suspect this is something about object selection for your action. Can you send me the file, so I can take a look? Send the file to my email. You can find my email in about page.
I'm sorry that I don't write my email address here. It's to avoid spam bot mining my email address :)
This is great, i followed it and even tried my own twist… i am an architect so i wanted to use it for Northings & Eastings, so i added a second attribute, so one shows Y coordiante (northing) and the other the X coordinate (easting), but when i move the leader the first attribute moves, but in completly strange way, and the second attribute does not move at all. any ideas?