<?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: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44930#M1171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for pointing me in the right direction!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is opening arcScene just fine, but when it tries to add the layer it just crashes and says "preparing elevation for display". Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer is selected, because I can use player.name, and it gives me the name of the DEM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Feb 2011 19:42:26 GMT</pubDate>
    <dc:creator>WilliamMcInnes</dc:creator>
    <dc:date>2011-02-01T19:42:26Z</dc:date>
    <item>
      <title>ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44928#M1169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to create a macro in ArcMap that transfers layers in ArcMap to ArcScene.&amp;nbsp; I am able to launch ArcScene with the commanditem function, but still unsure how to run code in ArcScene from ArcMap without any user intervention.&amp;nbsp; Also, is it possible to launch ArcScene with a specific document from ArcMap?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Answers in VBA would be preferable, but I'll take anything.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will McInnes&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jan 2011 22:12:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44928#M1169</guid>
      <dc:creator>WilliamMcInnes</dc:creator>
      <dc:date>2011-01-12T22:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44929#M1170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Will,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you are heading off in the wrong direction... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is some sample code that you would put in the on click event of a UIControl in an MXD. The code grabs the first layer in ArcMap, fires up ArcScene and then adds the layer. At this point you have a handle on the root object ISxDocument from which you can do all your stuff.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure you are referencing the esriArcScene library and have the 3D Analyst extension turned on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Public Sub test()
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Grab first layer in ArcMap&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMXDocument As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMXDocument = ThisDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMap As IMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pMap = pMXDocument.FocusMap
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pLayer As ILayer
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pLayer = pMap.Layer(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create an instance of ArcScene&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDocument As IDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pDocument = New esriArcScene.SxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pApplication As IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pApplication = pDocument.Parent
&amp;nbsp;&amp;nbsp;&amp;nbsp; pApplication.Visible = True
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Add a layer to ArcScene&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pSXDocument As ISxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pSXDocument = pDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp; pSXDocument.AddLayer pLayer
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 15:57:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44929#M1170</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T15:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44930#M1171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for pointing me in the right direction!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is opening arcScene just fine, but when it tries to add the layer it just crashes and says "preparing elevation for display". Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layer is selected, because I can use player.name, and it gives me the name of the DEM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 19:42:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44930#M1171</guid>
      <dc:creator>WilliamMcInnes</dc:creator>
      <dc:date>2011-02-01T19:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44931#M1172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Will,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;May be it's something weird to do with your DEM? Try passing a simple vector layer to it first to see it that works?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 08:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44931#M1172</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2011-02-02T08:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44932#M1173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One thing you'll need to be aware of when you do something like this is that ArcMap and ArcScene are running in two separate processes.&amp;nbsp; Objects from one process should not be used in the other as they are COM objects that are single apartment threaded and will not marshall correctly between processes.&amp;nbsp; You shouldn't do something like take a layer from ArcMap and add it directly to ArcScene.&amp;nbsp; If you do so, the layer object is being used in two processes.&amp;nbsp; The recommended thing to do would be to deep clone the layer object and add the clone to ArcScene.&amp;nbsp; Most ArcObjects classes can be deep cloned using the IObjectCopy interface.&amp;nbsp; Do not use the IClone interface as this only performs a shallow clone.&amp;nbsp; The other thing to be aware of is you shouldn't call New to create new instances of objects that you intend to use in the other process.&amp;nbsp; You should use IObjectFactory to create these instances.&amp;nbsp; This will create the object in the correct process space for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Feb 2011 12:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44932#M1173</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-02-02T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44933#M1174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The object factory was the key! You win 1000 bonus points. Thanks for the help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will McInnes&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Feb 2011 00:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44933#M1174</guid>
      <dc:creator>WilliamMcInnes</dc:creator>
      <dc:date>2011-02-09T00:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects 9.3 transfer layers from ArcMap to ArcScene Automatically</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44934#M1175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello every body&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;could you solve this issue !?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am tring to add a Raster Layer (RGB) with 3d properties (base heights) to my ArcScene which I open and get access to it trough C++.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I get problems with the opened ArcScene through C++ and the layer does not apear properly. Here are my codes ! is that the right way of opening ArcScene and adding layer (raster or feature) to it !?? I use ArcGIS Desktop 10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IAppROTPtr ipAppROT(CLSID_AppROT);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISxDocumentPtr ipSxDoc(CLSID_SxDocument);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDocumentPtr ipDoc(ipSxDoc);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CComPtr&amp;lt;IApplication&amp;gt; ipApl;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipApl.CoCreateInstance(CLSID_AppRef);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ipDoc-&amp;gt;get_Parent(&amp;amp;ipApl);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipApl-&amp;gt;put_Visible(VARIANT_TRUE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;then I try to add my Raster Layer which I have uploaded from my Raster Dataset and add it to my SxDocument like this :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;direct way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipSxDoc-&amp;gt;AddLayer(ipRstLyr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;through ILayer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ILayerPtr ipLyr(ipRstLyr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipSxDoc-&amp;gt;AddLayer(ipLyr);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;unfortunately neither the direct way works nor the one through ILayer !!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any idea ??? thank you very much. Nazereh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Apr 2012 11:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-9-3-transfer-layers-from-arcmap-to/m-p/44934#M1175</guid>
      <dc:creator>nazerehnejatbakhsh</dc:creator>
      <dc:date>2012-04-13T11:12:09Z</dc:date>
    </item>
  </channel>
</rss>

