POST
|
Hey Curtis - Thanks for your response! Unfortunately before moving away from the input box ArcGIS is placing a workspace in front of the inputted name. I am just going to go with a warning for users and move on. Your code helped me figure out how to do this, so thanks! if self.params[0].value and self.params[6].altered: outFC = str(self.params[6].value) self.params[6].clearMessage import os if os.path.dirname(outFC)!= str(self.params[0].value): self.params[6].setWarningMessage("Output location not within project folder!")
... View more
11-19-2012
12:38 PM
|
0
|
0
|
371
|
POST
|
Hi Arek - I am trying to make it easier when the user is inputting a parameter. I would like the default location for other named datasets being created point to the same directory. So for example the user has 1) Project Workspace parameter 2) Analysis Output location So the user sets their project workspace and then sets the name of the output location however since I am using a data type of Raster Dataset with an output direction, the parameter wants to use the current workspace set by the tool as the default location if a user just inputs a name. Additionally the browser dialog which opens points to the last workspace a dataset was written to which can also be different. I just want them both to point to the users selected workspace by default. I have attached an image which may make more sense. So in the image, the user selected test.gdb as their project workspace and then just typed in New which defaulted to creating the dataset in the Default.gdb (current workspace of tool) and then to make things even more convoluted if the user clicks to open a dialog they are being directed to the NewSetup.gdb which was one used by them most recently. If I click on the Environments button on the tool and then change the current workspace the default output location is the current workspace set. It just seems like I should be able to do this through code once the user selects their workspace. I guess I could just set warnings if the location of the output is in a different workspace than what the user selects. Thanks, jim [ATTACH=CONFIG]19379[/ATTACH]
... View more
11-16-2012
07:24 AM
|
0
|
0
|
371
|
POST
|
I have a tool which has the user select a workspace in the first parameter. Once the user selects the appropriate workspace I would then like the tool's environmental settings to be changed so the current workspace be set to that select workspace. What I am hoping to accomplish is if the user just inputs a name in a feature class output parameter, the new featureclass will be created in the previously selected workspace by default. I have tried using the ToolValidator however it doesn't seem to change the tool's environment settings. I have included code from my ToolValidator class showing two ways I have tried to accomplish this. Thanks for any advice or suggestions, Jim Oakleaf class ToolValidator: def __init__(self): import arcpy self.params = arcpy.GetParameterInfo() def initializeParameters(self): return def updateParameters(self): if self.params[0].altered: theW = self.params[0].value dsW=arcpy.Describe(theW) arcpy.env.workspace=dsW.catalogPath """Tried this method""" arcpy.env.scratchWorkspace=theW """Also tried this method""" def updateMessages(self): return
... View more
11-15-2012
12:53 PM
|
0
|
5
|
972
|
POST
|
have an application which does a spatial query based on the extent of the map display. All the services and map are in the same custom projection. When I use the 2.0 API the query task fails due to using a WKT coordinate system however if I switch back to the 1.6 API everything works fine. I have tried explicitly setting all the spatial references for the query and geometry and the query still fails. I could switch back to 1.6 however I am using the 2.0 API geometry service to project user-defined geographic locations in to this custom projection which is not supported in 1.6. Any ideas or thoughts would be appreciated? Thanks
... View more
07-14-2010
09:47 AM
|
0
|
0
|
524
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|