Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This really seems like I should be able to do this, but I am running into some problems. I want to import 3D Analyst with python, in the same way I import Spatial Analyst, but it returns an error.

For Spatial Analyst I use the following:

from arcpy.sa import *

This allows me to use the spatial analyst functions in python scripts outside of ArcMap. I want to do the same with 3D analyst, but I am running into an error.

I really feel like it should just be:

from arcpy.3D import *

I also tried arcpy.3d, but either way I get the error:

Parsing error <type 'exceptions.SyntaxError'>: invalid syntax (line 1)

Any help would be most appreciated, thanks in advance.

share|improve this question
    
I know that I can use a 3D Analyst tool with say: arcpy.aspect_3d(), but I am mainly wondering if I can import the 3D Analyst library the same way. –  Cody Brown Aug 23 '12 at 17:36
3  
Spatial Analyst is a module within arcpy which allows the from ___ import * syntax. 3D is not a module so you can't import it that way. –  twospeeder Aug 23 '12 at 18:10
    
Thanks for the info @twospeeder I was just starting to think the same thing. –  Cody Brown Aug 23 '12 at 18:15
1  
@twospeeder - You should post that as an official answer so that it is searchable by other people with potentially the same question. –  Get Spatial Aug 23 '12 at 18:25
    
Done. Thanks for the tip. –  twospeeder Aug 23 '12 at 19:43
add comment

1 Answer

up vote 4 down vote accepted

Spatial Analyst is a module within arcpy which allows the from _ import * syntax. 3D is not a module so you can't import it that way.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.