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.
it is not working for me.
Helpful tip, I don’t know if we can get the points’ coordinates in a table automaticaly??
Thanks a lot that was a huge help !
I’m looking for something like this using Station Points, e.g STA 00+00, using decimal units, where STA 01+02 = 102 feet. I created the XYCOORD dynamic block, above. I love it and will use it in my work. Thanks Edwin! Dave
Hi Dave,
Unfortunately, it is not possible in AutoCAD to annotate station points. There might be some AutoLISP routine to do that. But you should consider using Civil 3D.
Dear Sir,
Can we make this in Multitext
as I need N above the line and E below the line, Thank you
Dear Sir,
Can we make this in
Multitext
I needd N is above the line and E is below the line,
Thank you.
Hi Edwin, I’ve followed your instructions, but when I want to select ‘CENTER’ at prop. this doesn’t show… Could you please help me?
Can we remove the grey background of the block?
You can change the FIELDDISPLAY to 0 to hide the text field. Is that what you’re looking for?
Hi sir Edwin, ive use your autolisp coordinate program, can you help me edit the LISP, to set the default output without the leader arrow, cause i only need the X and Y UCS coordinates thanks!
Hi Edwin, I’ve created the block similar to yours, but it only gives me readings based on WCS even though I’m in my own UCS. Does it work only in WCS?
Hi Kin,
True, it only works in WCS. If you want to label it in UCS coordinate, you need to use AutoLISP approach. You can download the code here: Using AutoLISP Program to label point coordinate.