AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Valued Contributor
borderliner
Posts: 74
Registered: ‎07-18-2013
Message 1 of 26 (663 Views)
Accepted Solution

Coordinate System Variable

663 Views, 25 Replies
09-02-2013 02:12 PM

Hi, my problem of the day is, I want to have a piece of text added to the drawing notes that uses a field (or similar), to list the coordinate system code assigned to the drawing, i.e. UTM83-12.

Does anyone know if there’s a setvar or something that I can use?

 

I’m in Canada and they have a load of different coordinate systems to choose from, and I don’t want to have to manually enter it for every drawing.

 

Thanks

 

Here is a very crude method of doing what you want, borderliner. Save this lsp file to a location in your ACAD seacrh path. If you don't already have an acaddoc.lsp file create one in the same place as this lisp. Add these 2 lines to the acaddoc.lsp file:

 

(load "Coordsystem extraction.lsp")

(setusers1)

 

Now create a text/mtext object with a field set to use the SYSVAR USERS1. Unfortunately, the USER* sysvars are not directly available in the Field options, but you can use use Diesel expression to do it for you:

$(getvar, users1)

 

This text will now always show the value of USERS1. Note!!!!! This Sysvar does NOT get saved with the drawing, hence the use of the lisp in the acaddoc.lsp file which loads everytime a drawing is opened. Also, other lisp files MAY overwrite this setting, although it's been common practice to avoid using these sysvars unless it's the only option. So, while this does work and get you what you need, it could have it's pitfalls.

 

9-4-2013 12-31-28 PM.png

*Expert Elite*
BrianHailey
Posts: 2,868
Registered: ‎04-27-2005
Message 2 of 26 (645 Views)

Re: Coordinate System Variable

09-02-2013 05:16 PM in reply to: borderliner

I was hoping there was a system variable that shows what the current coordinate system of the drawing is but I can't find anything like that. I don't think it can be done without some additional programming (hopefully someone will prove me wrong here).

Brian Hailey
CAD-1.com
My Blog
*Expert Elite*
sboon
Posts: 2,226
Registered: ‎11-08-2005
Message 3 of 26 (617 Views)

Re: Coordinate System Variable

09-02-2013 08:31 PM in reply to: BrianHailey

As far as I know the list of coordinate systems used within Civil3d is the same one that the Map tools use to assign coordinate systems - try the MAPCSASSIGN command to see the other way of doing it.

 

If two different parts of the software are being used to do the same thing then they must be sharing a variable somewhere.

 

Steve
Please use the Accept as Solution or Kudo buttons when appropriate

*Expert Elite*
antoniovinci
Posts: 1,782
Registered: ‎06-03-2011
Message 4 of 26 (608 Views)

Re: Coordinate System Variable

09-02-2013 11:17 PM in reply to: borderliner

That's a typical "wish-list" good question, gentlemen.

Here's my workaround, waiting for a "true" solution by Autodesk.

1] export your drawing as DXF

2] open up this .DXF in Notepad and seek the ADE_PROJECTION string

3] two lines below it, you have the current CRS name, to be copied&pasted in your DWG legenda.

Distinguished Mentor
michael.robertson
Posts: 604
Registered: ‎03-18-2008
Message 5 of 26 (597 Views)

Re: Coordinate System Variable

09-03-2013 04:40 AM in reply to: borderliner

Don't know of the variable but in VB .NET code it is:

dim strCoordSys = CivilApplication.ActiveDocument.Settings.DrawingSettings.UnitZoneSettings.CoordinateSystemCode

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Valued Contributor
borderliner
Posts: 74
Registered: ‎07-18-2013
Message 6 of 26 (576 Views)

Re: Coordinate System Variable

09-03-2013 06:40 AM in reply to: sboon

This just brings up the dialog to assign coordinate systems. I onl y want to be able to reference it using a text field or something.

Distinguished Mentor
michael.robertson
Posts: 604
Registered: ‎03-18-2008
Message 7 of 26 (569 Views)

Re: Coordinate System Variable

09-03-2013 06:59 AM in reply to: borderliner

Which suggestion just brings up the dialog to assign coordinate system?

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Valued Contributor
borderliner
Posts: 74
Registered: ‎07-18-2013
Message 8 of 26 (567 Views)

Re: Coordinate System Variable

09-03-2013 07:02 AM in reply to: michael.robertson

MAPCSASSIGN brings up the dialog.

 

Maybe the question should be, is there a list of system variables specific to AutoCAD Map anywhere?

 

Valued Contributor
emelendez
Posts: 60
Registered: ‎07-01-2011
Message 9 of 26 (536 Views)

Re: Coordinate System Variable

09-03-2013 10:31 AM in reply to: borderliner

So if I understand this correctly, you want to add a field to text that will read a reference text line and you don't want to have to type it in every time. There are three workarounds I can think of.

 

1. If useing sheet set manager, add a custom project field. then input the text you want into that field. you can then add a field to reference the sheet set manager custom field.

 

2. If not using sheet set manager, you can add a piece of text somewhere in your drawing on a layer that is locked to prevent accidental erase. then create a field that is linked to an object. use the select from drawing option then once you select said text string, you can pick "contents" and it will duplicate what ever is in the text string.

 

3. If your annotation is created within your sheets, create a "dummy" sheet and name the tab what u want. then create a field to use a system variable. (field category: other, field names: systemvariable, system variable: ctab)

 

Hope this helps you out.

Edwin Melendez
AutoCAD Civil 3D 2013 Certified Professional
Certification No. 00319327
*Expert Elite*
antoniovinci
Posts: 1,782
Registered: ‎06-03-2011
Message 10 of 26 (524 Views)

Re: Coordinate System Variable

09-03-2013 11:49 AM in reply to: emelendez

emelendez wrote:

There are three workarounds I can think of


I fear none fits to the OP needs, sir.

He's looking for a way to fill a legenda field with the content of the current CRS (Coordinate Reference System) value.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.