POST
|
Well, I managed to track down a little documentation on this. ArcGIS Help 10.1 "Importing other python modules" Unfortunately the methods suggested in the documentation didn't work. Long story short I had zero success with the recommended methods of using sys.path.append, or the consolidation method. I eventually had to copy my own modules into the site-packages folder for the ArcGISx6410.3 folder within Python27. Hopefully if anyone else has this issue this might help them.
... View more
01-15-2015
11:16 AM
|
0
|
1
|
659
|
POST
|
Other modules import successfully, such as math, datetime and so forth. It seems just to be json that is problematic. I have found that when checking sys.executable from within a geoprocessing service, it returns the path to ArcSOC.exe, so they have baked an interpreter via COM into that executable I believe. As such I'm not sure where I would even install a module via pip, or if its possible.
... View more
01-13-2015
10:18 AM
|
0
|
1
|
659
|
POST
|
Hi Dan, I am doing that. In fact the traceback I posted contains 'import json' as the offending line of code, and ImportError itself is only thrown when an import or from ... import statement fails. If I didn't import the module and tried to use it, then it would raise a NameError. The script runs successfully in ArcMap, and satisfies multiple unit and acceptance tests run via the command line, so I am sure the code itself is not problematic. Its just this one import statement while run as a geoprocessing service that is the issue.
... View more
01-12-2015
04:35 PM
|
0
|
3
|
659
|
POST
|
Hello, I have recently created a geoprocessing service on ArcGIS server (10.3). When attempting to run this service, it fails almost immediately. Upon checking in the log files, I am getting an ImportError, specifically: Traceback (most recent call last): File "B:\arcgisserver\directories\arcgissystem\arcgisinput\ConfirmationSampling.GPServer\extracted\v101\webapp\confirmation_sampling.py", line 63, in import json ImportError: No module named json Failed to execute (ConfirmationSampling). Failed to execute (ConfirmationSampling). However, json is a standard python module and should be included in python without having to install a module, to my knowledge. I have tried to import it in the interpreters installed on the system and they have no problem doing so. Is there some python installation that ArcGIS server uses that I have to explicitly install this module for? If so can someone please tell me where it is, or link me to relevant documentation on this topic? I have been unsuccessful finding anything so far.
... View more
01-12-2015
03:30 PM
|
0
|
7
|
4860
|
POST
|
I have found this documentation which might lead in the right direction: ArcObjects Help for .NET developers However I'm not sure the best way to implement that, still wrapping my head around some of these ArcObjects concepts
... View more
09-19-2014
08:06 AM
|
0
|
1
|
287
|
POST
|
I'm currently running into the exact same issue. Did you have any success in solving this?
... View more
09-18-2014
09:41 AM
|
0
|
0
|
194
|
POST
|
Good morning, Are the controls which are used in the geoprocessing dialog (the window which opens when you double click a python script, for example) available through ArcObjects or WPF SDK anywhere? Specifically I would like to use the control associated with a Neighborhood parameter and include it in a dockable add-in I am creating. Of course it is possible to recreate this control myself, just figured it would save some time if ESRI has included these somewhere. I do not see them in the ArcGIS 10.2 WPF Controls section in the Design Toolbox, so I am doubtful, but figured I would ask anyways. Thank you.
... View more
09-17-2014
08:41 AM
|
0
|
3
|
1935
|
POST
|
Hello all, I am creating an interface in WPF that will call python scripts via the System.Diagnostics.Process method. This is working successfully and my scripts are completing just fine. I'm simply wondering if there is a way to call the arcgis Python instance rather than having to spawn a new one, similar to checking the 'Run Python Script in process' check box in a script's properties within arc. In doing so I hope to speed up the execution time of the script. I figure there may be a way to retrieve the process ID of the arcgis python instance via arcobjects, but so far have not found any documentation on the topic, can anyone provide some insight?
... View more
07-17-2014
11:58 AM
|
1
|
1
|
4146
|
POST
|
I got an answer to this over at StackExchange, basically the event isn't implemented for the TOC. There's a couple 'hack' workarounds to get more or less the same functionality, but in my case I have used this information to explain to my team lead why adding a button and click event will be more suitable to our needs.
... View more
07-10-2014
07:34 AM
|
0
|
0
|
323
|
POST
|
I have been trying to figure this out for almost a full working day and I just can't get it working. All I want to do is fire an event when the user clicks different layers in the arcmap table of contents. I can get it working with, for example, the PageLayout using this: IActiveViewEvents_Event pageLayoutEvent = ArcMap.Document.PageLayout as IActiveViewEvents_Event; I have googled and looked into a bunch of different threads, all revolving around the concept of 'IActiveViewEvents_Event' interfaces. Perhaps this is the wrong event interface for what I am trying to do. I've been able to get the event when the selection changes within the map document itself.. But I simply cant get an event to fire in the Table of Contents. My best attempt looks like this: IActiveViewEvents toc = ArcMap.Document.get_ContentsView(0) as IActiveViewEvents; IActiveViewEvents_Event tocEvent = ((TOCCatalogView)toc).SelectedItem as IActiveViewEvents_Event; However tocEvent is set to null. If I do not cast to IActiveViewEvents_Event, SelectedItem is not null... If anyone could provide a full example of doing this I would be very grateful!
... View more
07-09-2014
11:07 AM
|
0
|
1
|
2542
|
POST
|
You can use the arcpy.CreateFeatureclass_management method to create a feature class. Then you can publish to server using Servive Definition Files and the Publishing Toolset.
... View more
06-10-2014
11:33 AM
|
0
|
0
|
181
|
POST
|
The way you are checking the type is incorrect. arcpy.Parameter(x) will create a new Parameter object, not provide information about the parameter itself. Therefore check1.datatype will always default to String, since it is the default data type of a new Parameter object. Assuming your parameters are set like this in the script - [ATTACH=CONFIG]34484[/ATTACH] test = arcpy.GetParameter(0)
arcpy.AddMessage(type(test)) Should return <type 'float'> You can use these in conditionals like this: if type(1.0) == float: print "true" Also, its worth mentioning '#' in a double parameter field will actually return 0, not the '#' character. Hope that helps.
... View more
06-10-2014
11:19 AM
|
0
|
0
|
845
|
POST
|
Thanks Neil, that pointed me in the right direction. I wasn't able to find the registry key at HKLM\Software\ESRI\Desktop10.x., instead it was located at HKLM\SOFTWARE\Wow6432Node\ESRI\ArcGIS - much appreciated.
... View more
06-05-2014
06:35 AM
|
0
|
0
|
483
|
POST
|
Hi again, I am looking to get the Service Pack and Build numbers through ArcObjects. So far I can get the major version number using RuntimeManager.ActiveRuntime.Version; This returns "10.2" - but the requirements for what I'm working on want more specific information than that. I also saw this post on gis.stackexchange that states you can look up the service pack number based on the version number returned by Process.GetCurrentProcess().MainModule.FileVersionInfo.FileVersion; However this returns "11.0.50727.1" which does not correspond in any way to the list that they reference in that post. There is arcpy functionality in arcpy.GetInstallInfo() that is able to return these values, so I know it's got to exist in ArcObjects somewhere. Any ideas?
... View more
06-04-2014
02:08 PM
|
0
|
3
|
1914
|
Title | Kudos | Posted |
---|---|---|
1 | 07-17-2014 11:58 AM | |
3 | 03-19-2014 01:45 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|