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

Coordinate System Variable

36 REPLIES 36
SOLVED
Reply
Message 1 of 37
borderliner
4181 Views, 36 Replies

Coordinate System Variable

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

 

36 REPLIES 36
Message 2 of 37
BrianHailey
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 J. Hailey, P.E.



GEI Consultants
My Civil 3D Blog

Message 3 of 37
sboon
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

Steve
Expert Elite Alumnus
Message 4 of 37
antoniovinci
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.

Message 5 of 37

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
Message 6 of 37
borderliner
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.

Message 7 of 37

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

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 8 of 37

MAPCSASSIGN brings up the dialog.

 

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

 

Message 9 of 37
emelendez
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
Message 10 of 37
antoniovinci
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.

Message 11 of 37
emelendez
in reply to: antoniovinci

ahhhhh.....I didn't see that part where he was talking about adding it to a legend. Hence the reason why I added my understanding of the OP in my post. Either way, those are three workarounds for field info when system variables can't be found or digging for the right one is more frustrating than picking a booger with two broken hands.

Edwin Melendez
AutoCAD Civil 3D 2013 Certified Professional
Certification No. 00319327
Message 12 of 37
borderliner
in reply to: antoniovinci

antoniovinci is onto to what I'm after.

 

For anything that's geo-referenced you have to assign the coordinate reference system (CRS), which has an associated code, i.e. UTM83-12.

So I want a way of auto-populating a note in the legend that tells the reader what coordinate system the drawing is using. I type most of the note in and add a field (or Rtext, whatever), to add the CRS and everything's good.

 

If I have to type it in somewhere manually, then I might as well type it into the notes as well, it's meant to be easier, with less user input. Because to add it to the things members of our CAD group have to do already, it will get missed half the time - hence the auto-part of it.

 

Honestly, I thought someone would know what setvar/sysvar to use, and off I'd go.

 

Message 13 of 37

 

Don't know what version of C3D you are running but in 2014 (I think in 2013 but we never went to that version) there is a space on the status bar that shows you the current coordinate system. (see figure showing Florida NAD 83 East) If there is no system assigned, there will be nothing shown (the little pin on the left is the "Show Geomarker" toggle). This won't help you if you want to show the system on plots but will let the user know when they are in the dwg.

 

 

GeoCoords.png

Mike Robertson
FL. Dept. of Transportation
CADD Applications Developer
Message 14 of 37


michael.robertson wrote: 

This won't help you if you want to show the system on plots

 


Unfortunately the OP wanna indeed show the CRS value in a hardcopy (paper or PDF) probably to Acadless users...

As said before, I can't think of another system variable else than ADE_PROJECTION embedded in the .DXF output.

The problem is: how to extract it automatically, in order to populate the legenda field..?

Message 15 of 37
wfberry
in reply to: michael.robertson

Mike:

 

Good Call !  I feel somewhat ignorant not noticing this before.

 

It appears that "borderliner" could have a non-plotting note to his users to check the lower area of their model space for this.

 

Bill

 

Message 16 of 37

Mike, so very near, and yet.... I'm on C3D 2012 - and no info in the status bar.

 

It was only meant to be a self-populating peice of text, exactly the same as most people have on their drawings showing the file name and path, just a little info showing what CRS was used in the drawing.

 

Thank you all.

 

Message 17 of 37
Jeff_M
in reply to: borderliner

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

Jeff_M, also a frequent Swamper
EESignature
Message 18 of 37
borderliner
in reply to: Jeff_M

Jeff M - you the man.

This is where I expected this to go days ago.

 

Thank you

 

Message 19 of 37
borderliner
in reply to: Jeff_M

Jeff_M - While you're on the case, is it easy to extract the long description as well?

 

Message 20 of 37
Jeff_M
in reply to: borderliner

Yep, depending on how you want it...this will extract the description instead of the code:

 

(setvar 'users1 (vlax-get-property coordsystem 'description))

 

or this will make one string of the code & description:

 

(setvar 'users1 (strcat (vlax-get-property coordsystem 'cscode) ": " (vlax-get-property coordsystem 'description)))

 

 

Jeff_M, also a frequent Swamper
EESignature

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

Post to forums  

Rail Community


Autodesk Design & Make Report