Hello,
I am writing an Addin application in C# for Microstation CONNECT Edition and I want to ask if in those .NET libraries is any way to convert earth location (lat/long) to MS Dpoint3dt? If yes could you provide some example?
Thanks in advance.
Hi Piotr,
Piotr Czyzyk said:for Microstation CONNECT Edition
it's not clear what MicroStation CE version do you use. Please follow the best practices and specify the used version exactly (there have been 18 CE versions released so far).
Piotr Czyzyk said:is any way to convert earth location (lat/long) to MS Dpoint3dt?
Are you asking about conversion based on GCS defined for active model or your question is about a general conversion between CAD and geo coordinates?
In MicroStation, the question has been discussed several times (did you try to search this forum?).
In MicroStation Interop, GeoGraphicCoordinateSystem class is available, providing several conversion methods. I think there is no equivalent in new NET API (yet?).
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan,
I updated topic title to match 'release update language' pattern.
As you mentioned I need conversion based on GCS defined for active model. I added reference to Bentley.Interop.MicroStationDGN.dll but it provides Interface for GeographicCoordinateSystem.
I added reference for following dll:
\MicroStation\assemblies\ECFramework\Bentley.General.1.0.dll\MicroStation\assemblies\bentley.interop.microstationdgn.dll\MicroStation\assemblies\bentley.microstation.dll\MicroStation\assemblies\bentley.microstation.interfaces.1.0.dll\MicroStation\ustation.dll\MicroStation\Bentley.DgnPlatformNET.dll\MicroStation\Bentley.GeometryNET.dll.dll\MicroStation\Bentley.GeometryNET.Structs.dll
I can't find GCS class in any of them.
Piotr Czyzyk said:but it provides Interface for GeographicCoordinateSystem
Why "but"?
I did not test it, but I am pretty sure it's what you need (and the only what is available in NET API).
Regards,
DgnModel activeModel = Session.Instance.GetActiveDgnModel(); DgnGCS cs = DgnGCS.FromModel(activeModel, true);
DgnGCS should have everything you need.
You may need to include reference to Bentley.GeoCoord2.dll
Thanks for the information, I missed this class it in NET documentation :-)
Is this DgnGCS structure from Bentley.GeoCoordinates namespace? If yes I don't have 'FromModel' member.
and here is documantation I use:
make sure you reference Bentley.GeoCoordinatesNET assembly.
Well, it finally works. I also had to add reference to \MicroStation\Bentley.DgnGeoCoord2.dll because there was right Bentley.GeoCoordinatesNET assembly.
Thanks for help.