Last days I created some nodes based C# to simply working with Civil 3D (Map 3D) MAPCSLIBRARY or Geospatial Coordinate Systems (both names are valid) - these are local (and cloud) Autodesk’s database for keeping coordinate systems and working with them.
Nowadays, product collaboration is classic thing and one of main tasks for BIM-coordinator - linking different sofware (work in one coordinate system). There are only two products in Autodesk’s software that can work [read, edit] with Geospatial Coordinate Systems - Civil 3D and Map 3D (some years ago there was Infrastructure Map Server [as I remember] but it no actual today).
Standard system Library contains nearly 8240 definitions of CS. Unfortunatelly, in some states CS have private/secret status and they couldn’t were included in public library. So, Users must create definitions of CS and public it in local CSLibrary (folder %LOCALAPPDATA%\Autodesk\User Geospatial Coordinate Systems). Somewhen there is a needing to transfer part of Library to other User or all community and because of Autodesk Libraries files have binary data format (.CSD) there are no other way as shift those files. Other case - if User want export all CS definitions to external XML or TXT file (with f.e. WKT codes) - there are no automatically system commands besides step by step coping each definitions.
Why I create that topic and that Package? Anser is easy - lasy year I editing global CS_Library for Russia (it contains ~390 definitions of CS and some datums). ALso I helped my colleague from Belarus to create CS for that country (over 120 definitions)
So, let me go to MapConnection’s packages structure:
- There are to classes: CoordinateSystem and MapCSLibrary
- Nodes from CoordinateSystem’s class working with CS
– Node GetCurrentCoordinateSystem return the name of current CS (assigned to drawing)
– Node GetFullWKTCodeOfCS return full WKT code of input CS’s name (include geodetic datum)
Note: Autodesk.Gis.Map.Platform’s API (that let work with CS) have some bugs - f.e. for current version of MapConnection (1.0.0) system don’t return geodetic transformation in WKT code for TransverseMercator CS. I will solve it in end of that week (create WKT from Library’s database, besides standard Autodesk function).
- Nodes from MapCSLibrary’s class work with elements in Library database
– Node GetAllOfMAPCSLIRARY return external LSP file (with commang MAPCSLIBRARYEXPORT that contains all CS’s definition in User and System Library). User must load it lo Civil 3D and get XML-Library of all database
– Node GetPartOfMAPCSLIRARY also return LSP file, but User can select which parh of Library (system or Users) need to export
– Nodes CS_Language_RUS and CS_Language_ENG contains input parameters for nodes above (unportunatelly LSP files require names of elements in current language of program)
– Node GetListAndCountOfCategories return a list and count of all Categories of CS in Library’s database
– Node RenameCurrentCategory is rename one of existing Category from User input strings
– Node GetFullWKTCodeOfAllCS return all WKT codes for selecting part of Library database to external TXT files.
Note: by default all XML files (library database) creating in folder “Documents”, because if write a path - AutoCAD will be crash to fatal
Note: as was wrote above WKT codes for some CS’s types doesn’t creates (system problems). Also you cant’t import it to other software (f.e. QGIS). I try to change algoritm to create WKT files (or export tp PROJ.4 format…)
I hope that nodes form it collection help Users that have private Library and want transform it definitions to other formats or get it to smb