<?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 How do I convert a 2D map to 3D?  in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751181#M303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to convert a 2D map to 3D using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public Task&amp;lt;bool&amp;gt; Create3DView()&lt;BR /&gt; {&lt;BR /&gt; return QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; if (MapView.Active == null) return false;&lt;/P&gt;&lt;P&gt;Map pMap = MapFactory.Instance.CopyMap(MapView.Active.Map);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; CIMMap pMapDef = pMap.GetDefinition();&lt;BR /&gt; pMapDef.MapType = MapType.Scene;&lt;BR /&gt; pMap.SetDefinition(pMapDef);&lt;/P&gt;&lt;P&gt;var pLayers = pMap.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;();&lt;BR /&gt; foreach (var pLayer in pLayers)&lt;BR /&gt; {&lt;BR /&gt; var lyrDefn = pLayer.GetDefinition() as CIMBasicFeatureLayer;&lt;BR /&gt; //setting this property moves the layer to 3D group in a scene&lt;BR /&gt; lyrDefn.IsFlattened = false;&lt;BR /&gt; //Set the definition back to the layer&lt;BR /&gt; pLayer.SetDefinition(lyrDefn);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;pMap.SetName("3D Map");&lt;BR /&gt; await ArcGIS.Desktop.Core.ProApp.Panes.CreateMapPaneAsync(pMap, MapViewingMode.SceneLocal, null);&lt;/P&gt;&lt;P&gt;return true;&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I kept getting the following error:&lt;/P&gt;&lt;P&gt;"A 2D map cannot be opened as a 3D map. Convert the map first and then open."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set the map type to&amp;nbsp;&lt;SPAN&gt;MapType.Scene.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Oct 2018 21:56:19 GMT</pubDate>
    <dc:creator>FayuLai</dc:creator>
    <dc:date>2018-10-19T21:56:19Z</dc:date>
    <item>
      <title>How do I convert a 2D map to 3D?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751181#M303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to convert a 2D map to 3D using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public Task&amp;lt;bool&amp;gt; Create3DView()&lt;BR /&gt; {&lt;BR /&gt; return QueuedTask.Run(async () =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; if (MapView.Active == null) return false;&lt;/P&gt;&lt;P&gt;Map pMap = MapFactory.Instance.CopyMap(MapView.Active.Map);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; CIMMap pMapDef = pMap.GetDefinition();&lt;BR /&gt; pMapDef.MapType = MapType.Scene;&lt;BR /&gt; pMap.SetDefinition(pMapDef);&lt;/P&gt;&lt;P&gt;var pLayers = pMap.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;();&lt;BR /&gt; foreach (var pLayer in pLayers)&lt;BR /&gt; {&lt;BR /&gt; var lyrDefn = pLayer.GetDefinition() as CIMBasicFeatureLayer;&lt;BR /&gt; //setting this property moves the layer to 3D group in a scene&lt;BR /&gt; lyrDefn.IsFlattened = false;&lt;BR /&gt; //Set the definition back to the layer&lt;BR /&gt; pLayer.SetDefinition(lyrDefn);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;pMap.SetName("3D Map");&lt;BR /&gt; await ArcGIS.Desktop.Core.ProApp.Panes.CreateMapPaneAsync(pMap, MapViewingMode.SceneLocal, null);&lt;/P&gt;&lt;P&gt;return true;&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I kept getting the following error:&lt;/P&gt;&lt;P&gt;"A 2D map cannot be opened as a 3D map. Convert the map first and then open."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set the map type to&amp;nbsp;&lt;SPAN&gt;MapType.Scene.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2018 21:56:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751181#M303</guid>
      <dc:creator>FayuLai</dc:creator>
      <dc:date>2018-10-19T21:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a 2D map to 3D?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751182#M304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a Pro API bug?&amp;nbsp; Any help will be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2018 23:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751182#M304</guid>
      <dc:creator>FayuLai</dc:creator>
      <dc:date>2018-10-31T23:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I convert a 2D map to 3D?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751183#M305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We don't expose this functionality in the API (converting a map between 2D and 3D), but it's a good idea, and we may be able to add it in the near future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, try this: &lt;/P&gt;&lt;OL style="margin-top: 0in;"&gt;&lt;LI&gt;Create a brand-new scene (don’t copy the existing one).&lt;/LI&gt;&lt;LI&gt;Delete the default basemap layer.&lt;/LI&gt;&lt;LI&gt;Copy the layers over using LayerFactory.CopyLayer. At least this way, the layers’ symbology will be maintained, and in many cases, appropriate 3D-related defaults will be set.&lt;/LI&gt;&lt;LI&gt;Change the feature layers’ IsFlattened property, the way you’re already doing.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In lieu of a genuine ConvertMapToScene function, this should get you pretty close.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Pete Yurkosky&lt;/P&gt;&lt;P&gt;Programmer - ArcGIS Pro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Nov 2018 16:27:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-do-i-convert-a-2d-map-to-3d/m-p/751183#M305</guid>
      <dc:creator>PeterYurkosky</dc:creator>
      <dc:date>2018-11-01T16:27:46Z</dc:date>
    </item>
  </channel>
</rss>

