|
POST
|
Hi Jens, I apologize for the confusion. I was thinking this was a Runtime for .NET question and it appears that you needed the answer for the ArcGIS Pro SDK.
... View more
08-14-2015
09:53 AM
|
0
|
0
|
1429
|
|
POST
|
Hi Ana, You'll want to take note that there are two options that allow you to export to pdf. The one suggested by David is the ExportToPdf method of the mapping class. If you decide to use this class then you also have to included logic to advance to each page within the map document. The method I suggested is the exportToPDF method of the dataDrivenPages class. This option would handle all of the iteration logic for you. This method would provide you with parameters to allow you to both specify the pages to print or how many pdfs to create. Instead of iterating through each page, your logic could be as simple as follows (Note: I wrote this without verifying if it works😞 import arcpy
import os
def ExportToPDF(folder, pages, multiple_files, range_string="#"):
"""Walk specified directory to find files that in in *.mxd and export their
data driven pages to a pdf."""
# Walk the directory
for root, dirs, files in os.walk(folder):
for item in files:
# Check if file is an mxd
if not item.endswith(".mxd"):
continue
# Open mxd and hook into its data driven pages driver
mxd = arcpy.mapping.MapDocument(path.join(root, item))
ddp = mxd.dataDrivenPages
# Specify the output path for the pdf
pdf = os.path.join(root, item.replace(".mxd", ".pdf"))
# desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/datadrivenpages-class.htm
# Export the specified pages to the output pdf location
ddp.exportToPDF(pdf, pages, range_string, multiple_files)
if __name__ == '__main__':
ExportToPDF(r'C:\Path\To\Folder', 'ALL', 'PDF_SINGLE_FILE')
... View more
08-14-2015
09:48 AM
|
1
|
1
|
594
|
|
POST
|
Have you tried calling the ExportToPdf function of the DataDrivenPages class? DataDrivenPages http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-mapping/datadrivenpages-class.htm You could use python's os.walk method to locate your map documents and call the ExportToPdf method to create a pdf for each of the found map documents. Python OS.Walk Method http://www.tutorialspoint.com/python/os_walk.htm
... View more
08-13-2015
10:14 AM
|
1
|
1
|
2954
|
|
POST
|
You'll need to use the Make Feature Layer tool against your target table (i.e. the table where you want to see the join). The Join tool's first input must be a layer type as joins and selections can only be applied to layer objects. Make Feature Layer http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm Add Join http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/add-join.htm If you look at the Add Join tool you'll see that the first parameter is "in_layer_or_view". http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/add-join.htm
... View more
07-29-2015
07:48 AM
|
1
|
1
|
3467
|
|
POST
|
Have you tried using the geoprocessor to call the Table to Table Converstion tool? Table to Table http://desktop.arcgis.com/en/desktop/latest/tools/conversion-toolbox/table-to-table.htm How to Run a Geoprocessing Tool (ArcObjects) http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000003rr000000
... View more
07-29-2015
07:43 AM
|
0
|
0
|
4002
|
|
POST
|
I think the post from Duncan is what you're looking for. It does look like the call to InvokeModal will allow you specify the parameters for the tool prior to displaying the dialog. I've never tried this, but I'm definitely going to try this out on my end.
... View more
07-29-2015
07:36 AM
|
0
|
0
|
2069
|
|
POST
|
Are you setting the parameters type to Required because you want the user to be able to specify the output path on disk? If not, have you tried setting the type to derived?
... View more
07-28-2015
05:14 PM
|
0
|
0
|
836
|
|
POST
|
Is this what you're trying to do? Opening a geoprocessing tool's dialog box in .NET http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/Opening_a_geoprocessing_tool_s_dialog_box_in_NET/0001000001rz000000/ The above workflow would present your user's with the GP Dialog and they'd have to fill in the needed parameters. I'm not sure if you're running this logic within ArcMap, Engine, or a console application, but I'd think that if you wanted to show a dialog that already has the parameters for the tool filled in you'd need to create your own tool window, wire into the geoprocessor events, and then run the gp tool in the background so that you could use the geoprocessor events to update your progressor that you're showing in your dialog. Running a geoprocessing tool using background geoprocessing http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Running_a_geoprocessing_tool_using_background_geoprocessing/00010000015z000000/
... View more
07-28-2015
05:01 PM
|
0
|
1
|
2069
|
|
POST
|
The code does generate records based on the user's click coordinates, but as a result of applying this approach from a script tool the points are first collected from the tool's UI prior to being communicated to the code behind the tool as a FeatureSet. The Add-Ins framework will be a little different because you'd have access to the MouseEvents, which would only pass a single point one at a time instead of using a FeatureSet. My only suggestion would be to utilize the framework that provides the experience you're wanting. For example, say that you want to create a buffer based on the locations where a user clicks on the map. Option A would be to leverage the Script Tool/ModelBuilder approach. This would mean someone would open the GP tool, click everywhere on the map they want a point, and then click ok to begin processing. Option B would be to implement a Tool where you could wire into the map's OnMouseDown event. In this case every individual click would block the UI thread and generate a buffer prior to allowing the user to click the next point.
... View more
07-27-2015
04:12 PM
|
1
|
1
|
1569
|
|
POST
|
I think for what you're wanting you'll want to use a python addin so you can actually work with the OnMouseDown event and get a single xy coordinate when the user clicks on the map. Your point variable is actually referencing a FeatureSet object, which could contain multiple points. A call to arcpy.GetParameter would return the actual FeatureSet object, whereas your call to GetParameterAsText would return a path to the FeatureSet in memory (i.e. something similar to in_memory\{9F58A122-7DA8-42B0-A3DF-AD02622C1E6C}). The context of this line would be the same as if you were point to a feature class. This class would provide access to a table that you would need to parse and add its values to your table.
... View more
07-27-2015
03:56 PM
|
1
|
3
|
1569
|
|
POST
|
I'm not sure if I'm understanding your description correctly. Are you asking why the output to the Iterate Feature Classes tool shows a single feature class instead of a collection of features? If so, that is because after executing this tool you'd only see the value from the last iteration of the model. If you wanted to see all of the values you'd need to add the Collect Values tool into your model. Could you also verify what the variable "32dol_BDT_polys" represents. The iterator in this case should only take a workspace as input (i.e. folder, geodatabase, or feature dataset). For the most part, your model looks fine to me. The Add Geometry Attributes tool doesn't create new output, so in your model it should iterate through all of the feature classes in your specified workspace and add the attributes you specified in the tool.
... View more
07-27-2015
10:25 AM
|
1
|
4
|
2395
|
|
POST
|
07-27-2015
08:41 AM
|
1
|
1
|
6461
|
|
POST
|
I tested this on my machine and everything appears to work fine. Images of my model are shown below. Parent Model Notes: I need this model to create the new geodatabase once. As such, I've placed the iteration logic within a submodel in this model. The model is designed to grab the new geodatabase name from the source geodatabase. In this case your source was a personal geodatabase (*.mdb) and this model outputs a file geodatabase (*.gdb). It then feeds this newly created file geodatabase as the output workspace for the Iterate Datasets submodel and uses the personal geodatabase as the input workspace. Sub Model to Create Feature Datasets Notes: This model is designed to iterate through the input workspace and locate each of it's feature datasets. For each feature dataset found the model will use python to determine its spatial reference, grab the name of the feature dataset from the iterator, and use the specified output workspace to create a new copy of the feature dataset. Warning: As a result of an iterator being in this model the entire model will repeat for each dataset found. I'm not sure if you're wanting to use this model to recreate the entire geodatabase, but if you were you would continue this workflow to do so. I would think you'd need three more models to handle the other datatypes (i.e. tables, rasters, and feature classes). Due to the limitation that model can only contain a single iterator I would think you'd need a minimum of 6 models to complete this task, of which I've provided the first two. The end result would vary depending on how complex you want to setup the logic. In the above model I return the newly created feature datasets as a list and would want to build additional models to handle iterating through each of these workspaces. Otherwise you could implement logic to determine if the data is stored within a feature dataset and then locate and create the path to the matching feature dataset in the new workspace.
... View more
07-24-2015
05:05 PM
|
3
|
1
|
6461
|
|
POST
|
Yea...you may want to start a new thread for this. I think you'd need to use the executeAync method to fire those events.
... View more
07-24-2015
12:36 PM
|
0
|
1
|
2753
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-19-2016 04:45 AM | |
| 1 | 09-24-2015 06:45 AM | |
| 1 | 09-15-2015 10:49 AM | |
| 1 | 10-12-2015 03:07 PM | |
| 1 | 11-25-2015 09:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|