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
Solved! Go to Solution.
Solved by Jeff_M. Go to Solution.
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).
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
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.
Don't know of the variable but in VB .NET code it is:
dim strCoordSys = CivilApplication.ActiveDocument.Settings.DrawingSettings.UnitZoneSettings.CoordinateSystemCode
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.
Which suggestion just brings up the dialog to assign coordinate system?
MAPCSASSIGN brings up the dialog.
Maybe the question should be, is there a list of system variables specific to AutoCAD Map anywhere?
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.
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.
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.
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.
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.
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..?
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
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.
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.
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)))
Can't find what you're looking for? Ask the community or share your knowledge.