Select to view content in your preferred language

Python in ArcScene?

4429
3
07-04-2011 04:15 PM
GrantHerbert
Frequent Contributor
I am having a little trouble, thought I would use Python to repair a number of broken data sources but hit the following issue:

>>> import arcpy
>>> md = arcpy.mapping.MapDocument("CURRENT")
Runtime error <type 'exceptions.RuntimeError'>: Object: CreateObject cannot open map document


Is this something super simple (I am new to arcpy and Python) or is there another way to get the MapDocument in ArcScene (and ArcGlobe?).
Tags (1)
3 Replies
MJChurchill
Occasional Contributor
I am not sure if your problem has the same cause but I was getting the same error in ArcMap trying to run a Python script.
Finally I discovered the script tool needs to run 'in process' in order to be able to access the 'CURRENT' map document. (Right click on script in ArcToolbox, select Source tab and make sure 'Run Python script in process' is checked).

Hope that helps
0 Kudos
JamieDrisdelle
Occasional Contributor
Hi Grant,

Unfortunately the Arcpy.mapping module will not work in ArcScene because the arcpy.mapping.MapDocument() module is looking for a map document and not a scene document.  This is probably something that we should take into consideration though.  You might want to add this to our ideas site: 

http://ideas.arcgis.com/ideaHome?c=09a300000004xET
JamesCrandall
MVP Alum
Hi Grant,

Unfortunately the Arcpy.mapping module will not work in ArcScene because the arcpy.mapping.MapDocument() module is looking for a map document and not a scene document.  This is probably something that we should take into consideration though.  You might want to add this to our ideas site: 

http://ideas.arcgis.com/ideaHome?c=09a300000004xET


What is the status of this?  We have some VBA that processes ArcScene (9.3.1) document contents and will need to come up with solution for the ArcGIS 10.1 environment.
0 Kudos