POST
|
Hi Dan! Thanks a lot for your reply. I tried to make a function in calculate value tool but did not succeed. Instead if I try to elaborate and create a script in python that will take a geodatabase/featuredataset as input and place the featuredataset in TOC of a new mapdocument. My intension is to use the same dataframe from the current map document. My Idea is like this, # Import module import os import arcpy from arcpy import env # Set input parameter (I want to connect this script to the model output which is a geodatabase and param0 will take the .gdb as input) def getParameterInfo(self): param0 = arcpy.Parameter( displayName="Input Geodata", name="in_workspace", datatype="DEGeodatasetType", parameterType="Required", direction="Input") return param0 # Set environment arcpy.env.workspace = ("param0") mxd = arcpy.mapping.MapDocument("CURRENT") # Copy the dataframe from current mxd to a new mxd and add the inputted gdb to map document. for df in arcpy.mapping.ListDataFrames(mxd): for ds in arcpy.mapping.ListDataset(feature_type='feature') for fc in arcpy.mapping.ListFeatureClasses() mxd.saveACopy(r"C:\Users\attrab01\Downloads\PK\\" + "Project"+ ".mxd") del mxd1 # Open the new mxd automatic os.startfile(r"C:\Users\attrab01\Downloads\PK\\" + "Project" + ".mxd") This is a very basic and logical structure of my desired output. I would really appreciate if you can give me an exaple how to compile the code in python. Thanks in advance.
... View more
12-03-2017
11:00 PM
|
0
|
1
|
593
|
POST
|
Hi, I am new to python. I want to create a script that will take a geodatabase/featuredataset as input and place the featuredataset in TOC of a new mapdocument. My intension is to use the same dataframe in the current map document. My Idea is like this, # Import module import os import arcpy from arcpy import env # Set input parameter (I want to connect this script to the model output which is a geodatabase) def getParameterInfo(self): param0 = arcpy.Parameter( displayName="Input Geodata", name="in_workspace", datatype="DEGeodatasetType", parameterType="Required", direction="Input") return param0 # Set environment arcpy.env.workspace = ("param0") mxd = arcpy.mapping.MapDocument("CURRENT") # Copy the dataframe from current mxd to a new mxd and add the inputted gdb to map document. for df in arcpy.mapping.ListDataFrames(mxd): for ds in arcpy.mapping.ListDataset for fc in arcpy.mapping.ListFeatureClasses !! !! mxd.saveACopy(r"C:\Users\attrab01\Downloads\PK\\" + "Project"+ ".mxd") del mxd1 # Open the new mxd automatic os.startfile(r"C:\Users\attrab01\Downloads\PK\\" + "Project" + ".mxd") This is a workflow of my desired output. I would really appreciate if you can give me an exaple how to compile the code in python. Thanks in advance.
... View more
11-29-2017
06:59 AM
|
0
|
0
|
418
|
POST
|
Hi, Thanks for your reply. I am new to python. I tried to evaluate the expression above as you stated within the calculate value. But it takes save_mxd as a variable I think and It gives error result. Can you look at it and see what is the problem? Thanks in advance.
... View more
11-27-2017
07:34 AM
|
0
|
3
|
593
|
POST
|
Hi, I am trying to create a tool using model builder in Arcmap 10.4 which will allow the user to draw a polygon interactively and clip all layers within the polygon. The clipped layers will then be saved in an output file geodatabase containing a featuredataset having same name as the original layers. My input layers are from a file geodatabase containing featuredataset. My idea is to add the output to a new map document automatically or replace the existing TOC. I am attaching my tool, input and output file geodatabase. I will appreciate any kind of help regarding the Problem. Regards, Rimon
... View more
11-23-2017
11:48 PM
|
0
|
5
|
953
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|