<?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: add features to map in AutoCAD Map 3D Developer Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9399066#M377</link>
    <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;i use fdo connection and it works but dosent show in map&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You do not show any code that actually adds features.&amp;nbsp; If you use CTRL-A (select all) in autocad, are any objects selected?&amp;nbsp; Also, use quick select in Properties dialog.&amp;nbsp; Any objects?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are importing points, they may be hard to see.&amp;nbsp; Try PDMODE and PDSIZE (if you are trying to importing points as points - not blocks).&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2020 12:24:11 GMT</pubDate>
    <dc:creator>fieldguy</dc:creator>
    <dc:date>2020-03-25T12:24:11Z</dc:date>
    <item>
      <title>add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9396223#M374</link>
      <description>&lt;P&gt;i am new to autocad map3d . i want to add feature from sqlite database to map3d&amp;nbsp; in c# to edit them ,i create connection by code below but i dont know how add it to map!! can anyone help me?&lt;/P&gt;&lt;P&gt;OSGeo.FDO.IConnectionManager connManager = FeatureAccessManager.GetConnectionManager();&lt;BR /&gt;IConnection conn = connManager.CreateConnection("OSGeo.SQLite");&lt;BR /&gt;conn.ConnectionInfo.ConnectionProperties.SetProperty("ReadOnly", false.ToString());&lt;BR /&gt;string fileName = @"KaisMapData.sqlite";&lt;BR /&gt;conn.ConnectionInfo.ConnectionProperties.SetProperty("File", fileName);&lt;BR /&gt;conn.Open();&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 12:13:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9396223#M374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-24T12:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9396475#M375</link>
      <description>&lt;P&gt;some links:&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/infrastructure/2012/08/using-fdo-api-to-select-features-from-fdo-data-source.html" target="_blank" rel="noopener"&gt;https://adndevblog.typepad.com/infrastructure/2012/08/using-fdo-api-to-select-features-from-fdo-data-source.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://adndevblog.typepad.com/infrastructure/2012/05/connect-to-data-source-using-fdo-api.html" target="_blank" rel="noopener"&gt;https://adndevblog.typepad.com/infrastructure/2012/05/connect-to-data-source-using-fdo-api.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;did you download the map objectarx sdk?&amp;nbsp; &amp;gt;&amp;gt;&lt;A href="https://www.autodesk.com/" target="_blank" rel="noopener"&gt;here&amp;lt;&amp;lt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are code samples in the sdk&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2020 13:32:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9396475#M375</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2020-03-24T13:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9398369#M376</link>
      <description>&lt;P&gt;thanks for reply&lt;/P&gt;&lt;P&gt;i use fdo connection and it works but dosent show in map .my problem is showing on map in map3d&lt;/P&gt;&lt;P&gt;m&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 04:48:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9398369#M376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-25T04:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9399066#M377</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;i use fdo connection and it works but dosent show in map&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You do not show any code that actually adds features.&amp;nbsp; If you use CTRL-A (select all) in autocad, are any objects selected?&amp;nbsp; Also, use quick select in Properties dialog.&amp;nbsp; Any objects?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are importing points, they may be hard to see.&amp;nbsp; Try PDMODE and PDSIZE (if you are trying to importing points as points - not blocks).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 12:24:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9399066#M377</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2020-03-25T12:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9399318#M378</link>
      <description>&lt;P&gt;Firstly, by saying "...&lt;SPAN&gt;to add feature from sqlite database to map3d...", I assume you mean add feature into Acad Map VISUALLY, as map layer, just as you do it manually by opening "Data Connections" Palette, choosing a FDO provider, and and following the process... until the FDO data is retrieved from FDO source and shows up in Acad Map as a map layer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yes, you can use only FDO API to access (read and/or write) FDO source from Acad Map (as your partial code showed). However, with FDO API only, you only read the data into ACAD Map's memory. You can do whatever you wish with the data in memory (say, you can convert the geometries into native AutpCAD entities, line, circle, polyline... (thus visually appear in Acad), but the FDO data do not becomes Acad Map layer just because of being retrieved by FDO API. In order to do that, you need to use Acad Map geospatial platform API, which is built on top of FDO API.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It would be quite easy to get going by simply browsing some sample codes from Autodesk. If you haven't, download AutoCAD Map ObjectARX SDK (not that you must have it in order to write code, you don't), download it (any Acad Map version is fine), unzip it into any where in you drive, go to the folder "...\Map Samples\Platform", a lot of code samples on&amp;nbsp; Acad Map geospatial platform API. The solution "BuildMap" is exactly what you want to see.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 14:03:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9399318#M378</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2020-03-25T14:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9406078#M379</link>
      <description>&lt;P&gt;thank you&lt;/P&gt;&lt;P&gt;i use this sample and now i can add sqlite connection but still i cannot add it to map .it say "it say out of index bounds" my code is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OSGeo.FDO.IConnectionManager connManager = FeatureAccessManager.GetConnectionManager();&lt;BR /&gt;IConnection conn = connManager.CreateConnection("OSGeo.SQLite");&lt;BR /&gt;conn.ConnectionInfo.ConnectionProperties.SetProperty("ReadOnly", false.ToString());&lt;BR /&gt;string fileName = @"KaisMapData.sqlite";&lt;BR /&gt;conn.ConnectionInfo.ConnectionProperties.SetProperty("File", fileName);&lt;BR /&gt;ConnectionState connState = conn.Open();&lt;BR /&gt;ed.WriteMessage("connect status is " + connState.ToString() + "\n");&lt;/P&gt;&lt;P&gt;MgResourceService rs;&lt;BR /&gt;rs = AcMapServiceFactory.GetService(MgServiceType.ResourceService)&lt;BR /&gt;as MgResourceService;&lt;BR /&gt;MgFeatureService fs;&lt;BR /&gt;fs = AcMapServiceFactory.GetService(MgServiceType.FeatureService)&lt;BR /&gt;as MgFeatureService;&lt;BR /&gt;MgResourceIdentifier fsId = new MgResourceIdentifier(&lt;BR /&gt;"Library://gis_osm_buildings_a_free_1.FeatureSource");&lt;/P&gt;&lt;P&gt;// Create the feature source definition with a required&lt;BR /&gt;// parameter of File and an optional parameter of ReadOnly&lt;/P&gt;&lt;P&gt;string xmlString;&lt;BR /&gt;FeatureSourceType fsType = new FeatureSourceType();&lt;/P&gt;&lt;P&gt;fsType.Provider = "OSGeo.SQLite";&lt;/P&gt;&lt;P&gt;NameValuePairType param = new NameValuePairType();&lt;BR /&gt;param.Name = "File";&lt;BR /&gt;param.Value = @"C:\Users\OmraniS\Desktop\gis_osm_buildings_a_free_1.sqlite";&lt;BR /&gt;NameValuePairType param2 = new NameValuePairType();&lt;BR /&gt;param2.Name = "ReadOnly";&lt;BR /&gt;param2.Value = "True";&lt;BR /&gt;fsType.Parameter = new NameValuePairType[] { param, param2 };&lt;/P&gt;&lt;P&gt;// Serialize the feature source object model to xml string&lt;BR /&gt;using (StringWriter writer = new StringWriter())&lt;BR /&gt;{&lt;BR /&gt;XmlSerializer xs = new XmlSerializer(fsType.GetType());&lt;BR /&gt;xs.Serialize(writer, fsType);&lt;BR /&gt;xmlString = writer.ToString();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Convert the Unicode string to UTF8 bytes for Resource Service&lt;/P&gt;&lt;P&gt;byte[] unicodeBytes = Encoding.Unicode.GetBytes(xmlString);&lt;BR /&gt;byte[] utf8Bytes = Encoding.Convert(Encoding.Unicode,&lt;BR /&gt;Encoding.UTF8, unicodeBytes);&lt;/P&gt;&lt;P&gt;// Create a byte reader containing the XML feature&lt;BR /&gt;// source definition. Store the definition in the repository&lt;/P&gt;&lt;P&gt;MgByteSource xmlSource = new MgByteSource(utf8Bytes,&lt;BR /&gt;utf8Bytes.Length);&lt;BR /&gt;rs.SetResource(fsId, xmlSource.GetReader(), null);&lt;/P&gt;&lt;P&gt;IDescribeSchema descSchemaCmd = conn.CreateCommand(CommandType.CommandType_DescribeSchema) as IDescribeSchema;&lt;BR /&gt;FeatureSchemaCollection fsc = descSchemaCmd.Execute();&lt;BR /&gt;FeatureSchema schema = fsc[0];&lt;BR /&gt;MessageBox.Show((schema.Classes.IndexOf("@Default")).ToString());&lt;BR /&gt;ClassDefinition classDef = schema.Classes[schema.Classes.IndexOf("@Default")];&lt;BR /&gt;&lt;BR /&gt;MessageBox.Show(fsId.ToString());&lt;BR /&gt;MessageBox.Show(rs.ToString());&lt;BR /&gt;MgLayerBase layer = AcMapLayer.Create(fsId,rs);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;layer.SetName("NewLayer");&lt;BR /&gt;AcMapMap currentMap = AcMapMap.GetCurrentMap();&lt;BR /&gt;currentMap.GetLayers().Add(layer);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2020 11:38:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9406078#M379</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-28T11:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9905586#M380</link>
      <description>&lt;P&gt;Im working on the same issue..trying to make a SHP feature connection. But i have problem with a missing reference. I have the code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FeatureSourceType fsType = new FeatureSourceType();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone knows with dll I need?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2020 23:01:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9905586#M380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-30T23:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9910202#M381</link>
      <description>&lt;P&gt;To do AutoCAD geospatial (formerly called Platform) programming, the code needs to deal with FeatureSourceSchema and LayerDefinitionSchema. You can generate source code with MS' xsd.exe against the schemas provided the SDK (in folder "...\[SDK folder]\Schema\". To simply this work, the SDK also provides the source code in "...\[SDK folder]\Map Samples\Platform\Schema\", where there are 2 c# code file: FeatureSource-1_0_0.cs and LayerDefinition-1_3_0.cs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can copy these 2 classes into your project, if the project deals with FeatureSource and LayerDefinition. Better yet, you would place them in a shared class library, so that you only copy them once, just as the SDK sample project "Platform.Samples.Unit" does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 17:04:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9910202#M381</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2020-12-02T17:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: add features to map</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9910713#M382</link>
      <description>&lt;P&gt;thanx..its working now &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 20:20:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/add-features-to-map/m-p/9910713#M382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-02T20:20:19Z</dc:date>
    </item>
  </channel>
</rss>

