<?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: Slow Feature Reader!!! in AutoCAD Map 3D Developer Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6428256#M1355</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is one thing to keep in mind though - as we do not check property name and property type for each record we assume that the order of attributes is always the same for all records whilst iterating over the FeatureReader.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know if that is the case, I just hope it is - no good foundation for building applications. The documentation doesn't give any clue and one would need to look into the FDO source code to find out...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2016 04:27:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-07-11T04:27:46Z</dc:date>
    <item>
      <title>Slow Feature Reader!!!</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/5720510#M1351</link>
      <description>&lt;P&gt;Hi every body.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm developing an add-on to Map3D 2013, using .net4.0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To show non-spatial data of feature sources, I firstly used Map3D built-in form using &amp;nbsp;"_+MapDataTable" command and passing my layer definition&amp;nbsp;as it's argument, which works fine, but the problem was that the data table is editable (all fields but "OBJECTID"), but I need to allow user to view or view and edit on a specified layer. So I decided to develop my custom data view form, and fill data using the below code (based on MgFeatureReader&amp;nbsp;class):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private void UpdateTable()
        {
            
            if (SelectedLayer == null)
            {
                return;
            }
            if (SelectedLayer == "")
            {
                return;
            }
            if (!AcMapMap.GetCurrentMap().GetLayers().Contains(SelectedLayer))
            {
                return;
            }

           
            using (DocumentLock lck = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument())
            {
                
                Data = new System.Data.DataTable();
                Data.Columns.Clear();
                DataRow[] fldrs = FieldsTable.Select("layername='" + SelectedLayer + "'");

                foreach (DataRow fldr in fldrs)
                {
                    Data.Columns.Add(fldr["name"].ToString(), typeof(string));
                }

                int propertyCount;
                String propertyName;
                MgLayerBase layer = AcMapMap.GetCurrentMap().GetLayers().GetItem(SelectedLayer);
                MgFeatureReader featureReader = layer.SelectFeatures(new MgFeatureQueryOptions());

                while (featureReader.ReadNext())
                {
                    DataRow ndr = Data.NewRow();
                    propertyCount = featureReader.GetPropertyCount();
                    for (int i = 0; i &amp;lt; propertyCount; i++)
                    {
                        propertyName = featureReader.GetPropertyName(i);
                        if (!Data.Columns.Contains(propertyName))
                        {
                            continue;
                        }
                        ndr[propertyName] = featureReader.GetString(propertyName);
                    }
                    Data.Rows.Add(ndr);
                }
                dataGridView_list.DataSource = Data;
            }
        }&lt;/PRE&gt;&lt;P&gt;This code &lt;EM&gt;works without any error&lt;/EM&gt;, but it &lt;STRONG&gt;takes so long time&lt;/STRONG&gt;, based on number of fields of the data layer. &lt;STRONG&gt;(1 to 30 seconds even more!!!).&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Map3D's built-in interface, works rapid enough&amp;nbsp;and without any delay.&lt;/P&gt;&lt;P&gt;Does anyone knows about this? or, is there any solution to make Map3D's built-in data view interface read-only? &amp;nbsp;I'm really confused!!!&lt;/P&gt;&lt;P&gt;Any help would be appreciated greatly.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2015 12:43:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/5720510#M1351</guid>
      <dc:creator>a.hajihasani</dc:creator>
      <dc:date>2015-07-15T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Feature Reader!!!</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/5724348#M1352</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first of all I can confirm your observations - and I don't have an explanation nor solution.&lt;/P&gt;&lt;P&gt;To me it seems the FeatureReader itself is not the limiting factor but accessing the "properties" makes it slow.&lt;/P&gt;&lt;P&gt;Does anyone else have some information on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 08:02:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/5724348#M1352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-17T08:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Feature Reader!!!</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6423463#M1353</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it looks like calling GetPropertyType and GetPropertyName within the FOR loop slows things down.&lt;/P&gt;&lt;P&gt;Here are some further details:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://raumpatrouille3d.blogspot.ch/2016/07/map-api-mgfeaturereader-improve-speed.html" target="_blank"&gt;http://raumpatrouille3d.blogspot.ch/2016/07/map-api-mgfeaturereader-improve-speed.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All it takes is to get property name and property type for each column only once and store this information in an array (colProps) before iterating over the FeatureReader:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt; ...  
  while (featureReader.ReadNext())  
       {  
         counter++;  
         newRow = dt.NewRow();          
         for (int i = 0; i &amp;lt; colProps.Length; i++)  
         {  
           propertyName = colProps[i].PropertyName;  
           propertyType = colProps[i].PropertyType;  &lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Jul 2016 11:55:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6423463#M1353</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-07T11:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Feature Reader!!!</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6427645#M1354</link>
      <description>&lt;P&gt;Hi dead Robert.&lt;/P&gt;&lt;P&gt;I tried this and it worked greatly. Thanks a lot, I appreciate kindly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested this on a large data layer containing over than&amp;nbsp;13000 rows on 90 fields. It took about 15 seconds to respond. However, before applying this solution, it took along time about 30 minutes!!! So, that would be a great victory!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jul 2016 09:32:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6427645#M1354</guid>
      <dc:creator>a.hajihasani</dc:creator>
      <dc:date>2016-07-10T09:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Slow Feature Reader!!!</title>
      <link>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6428256#M1355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is one thing to keep in mind though - as we do not check property name and property type for each record we assume that the order of attributes is always the same for all records whilst iterating over the FeatureReader.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I don't know if that is the case, I just hope it is - no good foundation for building applications. The documentation doesn't give any clue and one would need to look into the FDO source code to find out...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 04:27:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-map-3d-developer-forum/slow-feature-reader/m-p/6428256#M1355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-11T04:27:46Z</dc:date>
    </item>
  </channel>
</rss>

