<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GEOMAP Customization in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6990808#M32031</link>
    <description>&lt;P&gt;I hope the screencast makes it more clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm trying to do is after I set my location, coordinate system and the drawing units and you click on next.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AutoCAD asks = Select a point for the location &lt;FONT color="#993300"&gt;&amp;lt;0,0,0&amp;gt;&lt;/FONT&gt; :&lt;/P&gt;
&lt;P&gt;Default its 0,0,0. But I want this point to be on &lt;FONT color="#993300"&gt;&amp;lt;147500,218590,0&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I want to be able to to that in the code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;In the code Kean sets the geolocation first geoPt (so thats the geoposition), and I thought that the wcsPt was the insertion point of that Geopoint.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;But when I look at the result of the code and the result when I do it manually its not the samen. See screenshot.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace GeoLocationAPI

{
  public class Commands
  {
    [CommandMethod("IGR")]
    public void InsertGeoRef()
    {
      var doc = Application.DocumentManager.MdiActiveDocument;
      if (doc == null)
        return;
      var ed = doc.Editor;
      var db = doc.Database;
      var msId = SymbolUtilityServices.GetBlockModelSpaceId(db);

      // Check whether the drawing already has geolocation data

       bool hasGeoData = false;
      try
      {

        var gdId = db.GeoDataObject;
        hasGeoData = true;
      }

      catch { }

      if (hasGeoData)
      {
        ed.WriteMessage("\nDrawing already has geo-location data!");
        return;
      }

      var data = new GeoLocationData();
      data.BlockTableRecordId = msId;
      data.PostToDb();

      data.CoordinateSystem = "Belge72.Lambert72a";
      data.TypeOfCoordinates = TypeOfCoordinates.CoordinateTypeGrid

      var geoPt = new Point3d(51.277178, 4.332933, 0);
      var wcsPt = new Point3d(147500,218590,0); //data.TransformFromLonLatAlt(geoPt);
      data.DesignPoint = wcsPt;
      data.ReferencePoint = geoPt;

      ed.Command("_.GEOMAP", "_AERIAL");

      using (var tr = db.TransactionManager.StartTransaction())
      {
        var ms =
          tr.GetObject(msId, OpenMode.ForWrite) as BlockTableRecord;
        if (ms != null)
        {
          var circle = new Circle(wcsPt, Vector3d.ZAxis, 7000);
          circle.ColorIndex = 1;
          ms.AppendEntity(circle);
          tr.AddNewlyCreatedDBObject(circle, true);
        }
        tr.Commit();
      }
      ed.Command("_.ZOOM", "_OBJECT", "_L", "");
    }
  }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="57870bee-5672-4e7c-a3df-676cf543f665" class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/57870bee-5672-4e7c-a3df-676cf543f665" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;" frameborder="0" width="640" height="650"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 03 Apr 2017 07:54:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-03T07:54:00Z</dc:date>
    <item>
      <title>GEOMAP Customization</title>
      <link>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6986714#M32029</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using this code: &lt;A href="http://through-the-interface.typepad.com/through_the_interface/2014/06/attaching-geo-location-data-to-an-autocad-drawing-using-net.html" target="_self"&gt;GeolocationCode&lt;/A&gt; to place a Geomap into my drawing. I've changed some settings like the data.coordintasystem to "Belge72.Lambert72A" and the coördinates to my location.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everythings works fine, but I want to be able to change the insertion point. When you manually insert a geomap you can choose the insertion point (x,y) at the end of the command. But I don't know how to do this in the Code the map is always placed at 0,0,0?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2017 09:00:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6986714#M32029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-31T09:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: GEOMAP Customization</title>
      <link>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6990680#M32030</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry I'm not able to figure out about your question, Geomap d&lt;SPAN&gt;isplays a map from an online maps service, in the current viewport. I don't there is a insertion point, I believe you already have created geoposition marker based on lat-long coordinate system, accordingly map gets displayed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you please share me &lt;A href="https://knowledge.autodesk.com/community/screencast" target="_self"&gt;screencast &amp;nbsp;&lt;/A&gt;recording of AutoCAD interactively of what you are looking for ?, may be I can get an idea.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2017 06:36:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6990680#M32030</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2017-04-03T06:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: GEOMAP Customization</title>
      <link>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6990808#M32031</link>
      <description>&lt;P&gt;I hope the screencast makes it more clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm trying to do is after I set my location, coordinate system and the drawing units and you click on next.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AutoCAD asks = Select a point for the location &lt;FONT color="#993300"&gt;&amp;lt;0,0,0&amp;gt;&lt;/FONT&gt; :&lt;/P&gt;
&lt;P&gt;Default its 0,0,0. But I want this point to be on &lt;FONT color="#993300"&gt;&amp;lt;147500,218590,0&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;I want to be able to to that in the code.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;In the code Kean sets the geolocation first geoPt (so thats the geoposition), and I thought that the wcsPt was the insertion point of that Geopoint.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;But when I look at the result of the code and the result when I do it manually its not the samen. See screenshot.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;

namespace GeoLocationAPI

{
  public class Commands
  {
    [CommandMethod("IGR")]
    public void InsertGeoRef()
    {
      var doc = Application.DocumentManager.MdiActiveDocument;
      if (doc == null)
        return;
      var ed = doc.Editor;
      var db = doc.Database;
      var msId = SymbolUtilityServices.GetBlockModelSpaceId(db);

      // Check whether the drawing already has geolocation data

       bool hasGeoData = false;
      try
      {

        var gdId = db.GeoDataObject;
        hasGeoData = true;
      }

      catch { }

      if (hasGeoData)
      {
        ed.WriteMessage("\nDrawing already has geo-location data!");
        return;
      }

      var data = new GeoLocationData();
      data.BlockTableRecordId = msId;
      data.PostToDb();

      data.CoordinateSystem = "Belge72.Lambert72a";
      data.TypeOfCoordinates = TypeOfCoordinates.CoordinateTypeGrid

      var geoPt = new Point3d(51.277178, 4.332933, 0);
      var wcsPt = new Point3d(147500,218590,0); //data.TransformFromLonLatAlt(geoPt);
      data.DesignPoint = wcsPt;
      data.ReferencePoint = geoPt;

      ed.Command("_.GEOMAP", "_AERIAL");

      using (var tr = db.TransactionManager.StartTransaction())
      {
        var ms =
          tr.GetObject(msId, OpenMode.ForWrite) as BlockTableRecord;
        if (ms != null)
        {
          var circle = new Circle(wcsPt, Vector3d.ZAxis, 7000);
          circle.ColorIndex = 1;
          ms.AppendEntity(circle);
          tr.AddNewlyCreatedDBObject(circle, true);
        }
        tr.Commit();
      }
      ed.Command("_.ZOOM", "_OBJECT", "_L", "");
    }
  }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="57870bee-5672-4e7c-a3df-676cf543f665" class="myscreencast-iframe iframe-container active-myscreencast"&gt;&lt;IFRAME src="https://screencast.autodesk.com/Embed/Timeline/57870bee-5672-4e7c-a3df-676cf543f665" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen" style="display: inline;" frameborder="0" width="640" height="650"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Apr 2017 07:54:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/6990808#M32031</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-03T07:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: GEOMAP Customization</title>
      <link>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/7006371#M32032</link>
      <description>&lt;P&gt;Sorry, I might have overlooked forum notification, please find in-line comments in corrected code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE style="color: #d1d1d1; background: #000000;"&gt;&lt;SPAN style="color: #e66170; font-weight: bold;"&gt;var&lt;/SPAN&gt; data &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;new&lt;/SPAN&gt; GeoLocationData&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;BlockTableRecordId &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; msId&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;PostToDb&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;

            data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;CoordinateSystem &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #00c4c4;"&gt;Belge72.Lambert72a&lt;/SPAN&gt;&lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;TypeOfCoordinates &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; TypeOfCoordinates&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;CoordinateTypeGrid&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            &lt;SPAN style="color: #9999a9;"&gt;/*geoPt should (long,lat,alt)&lt;/SPAN&gt;
&lt;SPAN style="color: #9999a9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Longitude ordinates are carried in the x member of AcGePoint objects,&lt;/SPAN&gt;
&lt;SPAN style="color: #9999a9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;latitude ordinates are carried in the y member of the AcGePoint object,&lt;/SPAN&gt;
&lt;SPAN style="color: #9999a9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;and elevation (altitude) is carried in the z member of the AcGePoint object. &lt;/SPAN&gt;
&lt;SPAN style="color: #9999a9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/SPAN&gt;
            &lt;SPAN style="color: #9999a9;"&gt;//var geoPt = new Point3d(51.277178, 4.332933, 0);&lt;/SPAN&gt;

            &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;var&lt;/SPAN&gt; geoPt &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;new&lt;/SPAN&gt; Point3d&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #009f00;"&gt;4.332933&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #009f00;"&gt;51.277178&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #008c00;"&gt;0&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            &lt;SPAN style="color: #e66170; font-weight: bold;"&gt;var&lt;/SPAN&gt; wcsPt &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #9999a9;"&gt;/*new Point3d(147500, 218590, 0);*/&lt;/SPAN&gt; data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;TransformFromLonLatAlt&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;geoPt&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            data&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;DesignPoint &lt;SPAN style="color: #d2cd86;"&gt;=&lt;/SPAN&gt; wcsPt&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
            &lt;SPAN style="color: #9999a9;"&gt;//In the case of design coordinates of the coordTypGrid or coordTypGeodetic types, this specification is not required&lt;/SPAN&gt;
            &lt;SPAN style="color: #9999a9;"&gt;// data.ReferencePoint = geoPt; &lt;/SPAN&gt;

            ed&lt;SPAN style="color: #d2cd86;"&gt;.&lt;/SPAN&gt;Command&lt;SPAN style="color: #d2cd86;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #00c4c4;"&gt;_.GEOMAP&lt;/SPAN&gt;&lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #00c4c4;"&gt;_AERIAL&lt;/SPAN&gt;&lt;SPAN style="color: #02d045;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #d2cd86;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #b060b0;"&gt;;&lt;/SPAN&gt;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Apr 2017 11:40:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/geomap-customization/m-p/7006371#M32032</guid>
      <dc:creator>moogalm</dc:creator>
      <dc:date>2017-04-10T11:40:31Z</dc:date>
    </item>
  </channel>
</rss>

