Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Label Northing and Easting macro

2 REPLIES 2
Reply
Message 1 of 3
tbronson
1399 Views, 2 Replies

Label Northing and Easting macro

I would like to create a toolbar command to label northing and easting.  I know I can label it using Note Label, but can I make this into a macro with a shortcut button?

Thanks,

Todd

2 REPLIES 2
Message 2 of 3
Jeff_M
in reply to: tbronson

This can be done, but you will need some lisp to do it....See This Thread for how it was done for surface spot label styles. The same idea can be applied to set the Note Label Style, then call the _AeccAddNoteLabel command.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 3
TerryDotson
in reply to: tbronson

Have you considered creating a block with fields?  Once created (and inserted) you can simply copy/move it and the new coordinates update on the next regen.  Rather than supply one which you won't learn anything from, follow this procedure and you will be ready to create your own in the future.

 

Building a block with fields

 

This procedure will explain how to create a coordinate label block that updates as you move or copy it.

 

  1. Launch AutoCAD (2006 or higher).
  2. Issue the BEDIT (block edit) command.
  3. Enter the desired name, like COORDBLOCK and chose OK.
  4. Draw the desired point identifying geometry, such as a circle at 0,0 with a radius of 0.25.
  5. Issue the ATTDEF command.
  6. Turn on the Preset toggle in the upper left, this makes for faster inserts as AutoCAD won't prompt for the  attribute values (which is automatic anyway).
  7. Enter NORTHING for the tag and prompt fields.
  8. To the right of the Value field, click the 'Insert Field' button.
  9. In the Field Names list on the left, click 'BlockPlaceholder', this is a special area only available during block building.
  10. In the middle column, choose the 'Position' property.
  11. In the right column, format your output as desired.  In this example turn off the X & Z fields and 'Current Units' is the recommended value.  While you can lock the precision to a fixed number of places, it's not easy to modify a field based attribute later.
  12. Choose OK after completing the field formatting.
  13. Change 'Text Options' as desired.  For this example we are only changing the height to 1.0.
  14. Most likely you will want to turn off the 'Lock Position' toggle so you can move the attribute after the insert.
  15. Choose OK to complete the first attribute.  When prompted for the insertion point, pick a location or enter coordinates such as 1.0,1.2 for this example.
  16. Repeat at step 5 for the EASTING & ELEVATION field attributes, the only other difference being that the 'Align below previous' toggle should be turned on to make positioning easier.
  17. Issue the BCLOSE command or choose the 'Close Block Editor' button at the top.
  18. Choose Yes to save the changes.

At this point the COORDBLOCK is defined and ready to insert.  As you insert them into the drawing the coordinates are filled in automatically.  After moving an insert issue the REGEN command to update the values.   To make the block available for inserting into other drawings, it will need to be WBLOCKED to a separate DWG file.

 

  1. Issue the WBLOCK command.
  2. Choose the Block button and select COORDBLOCK in the list.
  3. Click the [...] in lower right to specify a filename.
  4. Changing the Insert Units to 'Unitless' is recommended.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report