New package for Geospatial Coordinate Systems and tools to MAPCSLIBRARY

Hi, everyone;
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 :sweat_smile: - 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 :wink:
    – 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 :joy:

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

5 Likes

In that Post I retry material above, but in Russian - for my colleagues that have necessity in that toolpack
Добрый день, представленная выше сборка (Пакет) под названием MapConnection является пользовательской библиотекой нодов под Dynamo для работы с библиотекой систем координат.
На текущий момент она содержит 2 класса (к слову оба класса представленные public class не выполняют никаких действий (пустые))
Класс CoordinateSystems содержит 2 нода:

  • GetCurrentCoordinateSystem - получает код текущей назначенной чертежу СК и возвращает его в виде наименования (Name) системы координат из словаря
  • GetFullWKTCodeOfCS формирует полный WKT-код Системы координат (далее, СК) включая информацию о численных параметрах датума - в системной версии инф. о датуме нет.

Примечание: данная опция не работает для некоторых типов СК, напр., о проекции Поперечная Меркатора (системные ограничения). Я буду пытаться обходить это с помощью алгоритма формирования описания проекции по словарю в формате XML
Класс MapCSLibrary содержит следующие ноды:

  • GetPartOfMAPCSLIBRARY - формирует LSP файл, содержащий запрос к Civil 3D (Map 3D) по извлечению параметров СК и связанных с ними определений. При этом пользователь может выбрать какую часть библиотеки (пользовательскую или системную) извлекать.
  • GetAllOfMAPCSLIBRARY - делает тоже самое что и GetPartOfMAPCSLIBRARY только для всей библиотеки целиком
  • CS_Language_RUS и CS_Language_ENG содержат входные параметры для нодов выше - так как функции в LSP файле прописываются согласно текущей языковой оболочки программы
  • GetListAndCountOfCategories формирует список (List <>) для категорий СК в словаре программы и выводит число этих категорий (int)
  • RenameCurrentCategory - переименовывает имеющуюся категорию из словаря, принимая на вход ее текущее имя и необходимое (на латинице)
  • GetFullWKTCodeOfAllCS - экспериментальный нод, формирует полный WKT код для требуемой части библиотеки (полной/только системной/только пользовательской), но для него действуют те же ограничения что и для одиночного WKT. В рамках данного нода записываются 3 файла (содержащие описания СК, урезанного WKT и полного WKT) в указанном пользователем каталоге
    Примечание: все создаваемые XML-файлы библиотеки сохраняются в папке “Документы”; так как при задании своего пути в файле LSP он может фатально вылетать

P.S. Версия не окончательная, будет улучшаться для поддержки как минимум одного из форматов описания СК для импорта в другое ПО.

H, all!
I updated package to version 1.0.3 (versions 1.0.1 and 1.0.2 - my trieds to download package to site :sweat_smile:)
What’s new?
Class “CoordinateSystem”
– Node GetCurrentCoordinateSystem don’t changed
– Node GetWKT2Code_ofCSLIst is new action that return an external TXT file for selecteds CS (input file with CS’s names)
Class “MapCSLibrary”
– Node GetCSList creates a list of CS to external txt file
Note: at that moment I can’t add support to add Category name but I promise done in in future realises (to select smaller groups of CS)
– Other nodes don’t changed
I recorded a process to getting WKT2 codes of CS (node GetWKT2Code_ofCSLIst) as result of work nodes collection [GetPartOfMAPCSLIBRARY, GetCSList, CS_Language_RUS] and as final checking -importing one of created definition to QGIS where I’m get a valid confirmation.
Note: at that moment WKT2 code created for CS “Transwerse Mercator” and “Gauss Kruger”, that have geodetic transformation to WGS-84. I will extending functional of export (it were “test” actions)


Unfortunatelly I can’t attach a video larger than 4 Mb - so here a link to it.
P.S. I look forward to any comments of that toolpack and bug-detection (because I can have a mistake in code)
**** on Russian
Настоящая версия сборки (1.0.3) содержит изменения для нода GetWKT2Code_ofCSLIst, который формирует внешний TXT файл с полными кодами WKT для заданного списка наименований СК. Поясняющее видео приведено выше по ссылке - с демонстрацией работы данного нода + трех вспомогательных, которые формируют файлы для него.
Буду рад обратной связи. особенно связанной с обнаруженными багами в итоговых формулировках данных.

Any chance that this node can be modified to include a file / document input? Basically allowing for batch reporting of file coordinate systems? My apologies, I am new to the world of scripting.

Hmmm, as what form did you want as a report? Standard report (as XML-file) is created as library-definition.
Because of for generation XML-library you need load LISP file (outside from current session of script), it isn’t a “batch scenario”. From other side - if you want get only f.e. names of all CS - you can change script to that form:


I remember that all scripts you can find at that web-page: Dynamo.MapConnection/DynamoScripts at main · TBS-Software/Dynamo.MapConnection · GitHub

I have hundreds of files for which I need to check the applied coordinate system. I have found a series of nodes that may reference a number of files, but the “Get Current Coordinate System” Node that you’ve developed does not have an input to specify a file other than the currently opened file.