POST
|
How did you add that tool to the model? Did you drag it out of a toolbox? I cant find any documentation on that tool. If you got it from a toolbox you should be able to right click on the tool and see its help docs. The help doc will have the proper syntax for it in python. The error you are getting is that the tool, as it is in your code, doesnt exist in the arcpy site package. I also see that error quite often when I'm running a 9.x script in 10.x. Do you have the case (upper/lower) correct? - GetJobAOI_WMX Thanks for your replies. I drag it out of the Workflow Manager Tool toolbox indeed. This helptext is shown after right click: Get Job AOI (Workflow Manager) ArcGIS 10 Summary Gets the job's area of interest layer as a feature layer. This layer can be used to perform other analysis by plugging the output into other geoprocessing tools in a model. Usage The input job id must be for a job that currently exists and has an AOI defined. If an AOI doesn't exist, an empty output will be generated. Syntax GetJobAOI_wmx (Input_JobID, aoi_Layer, {Input_DatabasePath}) Parameter Explanation Data Type Input_JobID The ID for the job's AOI retrieved. String aoi_Layer The layer name for the AOI retrieved. Feature layer Input_DatabasePath (Optional) The Workflow Manager database connection file for the input job. connection file (.jtc) Code Sample Get Job AOI # Import arcpy module import arcpy # Check out any necessary licenses arcpy.CheckOutExtension("JTX") # Script arguments Input_DatabasePath = arcpy.GetParameterAsText(0) Input_JobID = arcpy.GetParameterAsText(1) # Local variables: AOI_Layer = "AOILayer_Job1" # Process: Get Job AOI arcpy.GetJobAOI_WMX(Input_JobID, AOI_Layer, Input_DatabasePath) Environments This tool does not use any geoprocessing environments Licensing Information ArcView: No ArcEditor: Requires Workflow Manager ArcInfo: Requires Workflow Manager It just not runs in a script ...
... View more
06-14-2011
11:49 PM
|
0
|
0
|
436
|
POST
|
Hello, I created a model and included the tool Get Job AOI from the Workflow Manager Tool toolbox. Then i created a script from the model:
# ---------------------------------------------------------------------------
# GetAOI.py
# Created on: 2011-06-10 14:43:14.00000
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Check out any necessary licenses
arcpy.CheckOutExtension("JTX")
# Local variables:
AOI = "AOI"
# Process: Get Job AOI
arcpy.GetJobAOI_WMX("114298", AOI, "")
The model runs without any problems, but the script gives me this error: <type 'exceptions.AttributeError'>: 'module' object has no attribute 'GetJobAOI_WMX' What am i missing? Greeting, Henk
... View more
06-10-2011
04:50 AM
|
0
|
10
|
2140
|
POST
|
Thanks, that works. I suggest to rename this property to isInsideGroupLayer :confused: Is there a way to findout what the name of the grouplayer is? Greetings, Henk
... View more
06-08-2011
05:47 AM
|
0
|
0
|
577
|
POST
|
Hello all, Is there a way in Python/Arcpy to find out if a featurelayer is in a grouplayer? Greetings, Henk
... View more
06-08-2011
12:58 AM
|
0
|
5
|
1396
|
POST
|
Now i see that i made a mistake. I thought i was handling a labelsymbol, but it was a symbol from the classrenderer. The symbol for labeling is a textSymbol and now a can use formattedTextSymbol to access the properties i want. Thanks, Henk
... View more
01-21-2011
12:45 AM
|
0
|
0
|
206
|
POST
|
http://forums.arcgis.com/threads/5945-drawing-an-icharactermarkersymbol I don't see how this link helps me to find what i'm looking for 😞 Henk
... View more
01-20-2011
11:46 PM
|
0
|
0
|
206
|
POST
|
Hello all, It must be simple, but i don't see it. I'm looking for a way to access all properties of a characterMarkerSymbol: Formatted text, fill pattern, background and mask. Can somebody help with this.
If TypeOf pSymbol Is ICharacterMarkerSymbol Then
Dim pCharacterMarkerSymbol As ICharacterMarkerSymbol
Set pCharacterMarkerSymbol = pSymbol
debug.print pCharacterMarkerSymbol.Angle
...
'background ...
'fill pattern ...
'schadow ...
endif
Thanks, Henk
... View more
01-20-2011
04:34 AM
|
0
|
4
|
925
|
POST
|
Thanks Jeff, that's what i was looking for. Don't know why i misst that 😞 Henk
... View more
01-12-2011
10:49 PM
|
0
|
0
|
159
|
POST
|
Hello all, I'm building a tool that gathers all Maplex labelproperties for all labelclasses of all layers in an mxd. The result is stored in a csv-file, to get a sort of overview. In the code below i'm using IMaplexOverposterLayerProperties to access these labelproperties. The problem is that i can't access all the properties that are visible in de Maplex placement dialogs. One of them is the checkbox Measure offset from feature geometry that is in the dialog Layer Properties->Placement Properties->Label Position->Label Offset of a point featureclass. Can somebody tell me the way to access this setting? Greetings, Henk
Private Function processAnnotation(pFeatureLayer As IFeatureLayer)
Dim pAnnoPropsCol As IAnnotateLayerPropertiesCollection
Dim pAnnoProps As IAnnotateLayerProperties
Dim pOverProps As IOverposterLayerProperties
Dim pLabelEngineLayerProperties2 As ILabelEngineLayerProperties2
Dim pMaplexOverposterLayerProperties As IMaplexOverposterLayerProperties
Dim pGeoLayer As IGeoFeatureLayer
Set pGeoLayer = pFeatureLayer
If pGeoLayer.DisplayAnnotation Then
Set pAnnoPropsCol = pGeoLayer.AnnotationProperties
Dim i As Long
For i = 0 To pAnnoPropsCol.count - 1
pAnnoPropsCol.QueryItem i, pAnnoProps
Set pLabelEngineLayerProperties2 = pAnnoProps
Set pMaplexOverposterLayerProperties = pLabelEngineLayerProperties2.OverposterLayerProperties
Print #lFileId, "Placement Method: " & pMaplexOverposterLayerProperties.PointPlacementMethod
Print #lFileId, "Can Shift Point Label " & pMaplexOverposterLayerProperties.CanShiftPointLabel
'....
'....
'....
Next i
End If
End Function
... View more
01-12-2011
03:42 AM
|
0
|
2
|
1854
|
POST
|
How are you adding layer names to the ComboBox? are you using recursion to find any nested layers inside a group layer? Or simply looping through the layers in the table of contents? See my code i posted. What exactly are you doing with the layer that the user selects? User selects a layer and hits a startbutton: - Write all the features from selected layer that match the definition query to a scratch database. - Add a topologyclass with some rules. - Validate the topology. - Create 3 new featureclasses containing the geometries of the topology errors. - Add the new featureclasses to the map. Why? Because we are working an a SDE Oracle database that omits some topology rules. We can't change that in a short time because of the changemanagementsystem. Henk
... View more
12-16-2010
11:44 PM
|
0
|
0
|
213
|
POST
|
See...handling same layers name is not an issue...only thing is how user can feel good to use...what he suppose to select if he wants to see the building or something...why he suppose to check all building layers ? It's a very smart user 😉 . He adds two layers with the same name en applies two different definition queries. For the moment its easy to remember which layers and what queries he added while testing his code. When he selects a layer in de combobox the form shows the definition queries he applied and so he knows what layer to select. He selects the second layer and hits the commandbutton to perform an action on that layer. Now he is wondering why the tool is processing the wrong features. It takes 10 seconds to find out what the problem is: the code is using only the name of the layer and finds the first layer. So he thinks of a solution. There must be a another way to identify a layer, but he can't figure it out and goes to this forum to find an answer to his problem. He decides to change the code so that it's checking for duplicate names in the TOC and renames them without asking: Sub getlayers()
Dim pMxDocument As IMxDocument
Dim pMap As IMap
Set pMxDocument = ThisDocument
Set pMap = pMxDocument.FocusMap
Dim Player As ILayer
Dim pEnumLayers As IEnumLayer
Dim pFeatureLayer As IFeatureLayer
Dim pId As New UID
pId = "{E156D7E5-22AF-11D3-9F99-00C04F6BC78E}" 'Find only IGeoFeatureLayers
Set pEnumLayers = pMap.Layers(pId, True)
If pEnumLayers Is Nothing Then Exit Sub
Dim newName As String
Randomize
Set Player = pEnumLayers.Next
Do While Not Player Is Nothing
If Player.Valid Then
Set pFeatureLayer = Player
If nameInList(ComboBoxLayers, pFeatureLayer.name) Then
newName = pFeatureLayer.name & Int(Rnd * 100)
MsgBox "Layer " & pFeatureLayer.name & " renamed to " & newName, vbInformation
pFeatureLayer.name = newName
pMxDocument.CurrentContentsView.Refresh 1
End If
ComboBoxLayers.AddItem pFeatureLayer.name
End If
Set Player = pEnumLayers.Next
Loop
End Sub
Function nameInList(ComboBoxIn As ComboBox, name As String) As Boolean
Dim i As Long
For i = 0 To ComboBoxInlistCount - 1
If ComboBoxIn.List(i) = name Then nameInList = True
Next i
End Function Now everybody is happy because there are no duplicate names anymore. Thank you all. Henk (Still thinking about implementing Alexander Gray's solution of using a generic list of IFeatureLayers)
... View more
12-08-2010
11:12 PM
|
0
|
0
|
213
|
POST
|
Why don't you make names as by type Commercial building and residential or by size Large Constructions and Small Constructions something like that ? I know, but it is up to the user of my tool what names he uses. My tool must be able to handle layers with equal names.
... View more
12-07-2010
11:25 AM
|
0
|
0
|
213
|
POST
|
And what about selecting (hilite) the layer in the TOC that matches with the item user selects in the combobox?
... View more
12-03-2010
06:32 AM
|
0
|
0
|
283
|
Title | Kudos | Posted |
---|---|---|
179 | 04-26-2010 04:36 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|