|
POST
|
Good day everyone, I have the following model: Which seems to run fine (based on the output to the dialog display): But even though the output shows that the "Copy Features" tool created "site_polygon2", I cannot find it in Catalog (even after refresh): I would expect it to show up under "site_polygon". If I look in windows explorer in the data_for_item.gdb folder, I do see the following lock file: I am stumped as to why I can't find site_polygon2. The help is always appreciated. Thanks, Chris
... View more
05-05-2016
09:50 AM
|
0
|
10
|
9363
|
|
POST
|
Hi Rebecca, When you have a moment could you elaborate a bit on your comment, "there are better ways to do it..no need to open each one physically". Thanks, Chris
... View more
05-02-2016
07:06 AM
|
0
|
0
|
5751
|
|
POST
|
Thanks for the feedback everyone. Lots to learn! Have a good day.
... View more
05-02-2016
07:04 AM
|
0
|
0
|
1166
|
|
POST
|
I have a modelbuilder model which copies a number of mxd files to a new folder based on a index number that the user enters. The index is used for the name of the new folder and is also appended to the front of each mxd file. Once the files are copied I want to open one of them which is what the os.startfile accomplishes. I just think it would be nicer if it opens in the instance that is already open. If there is a better way to do this, please let me know. Thanks!
... View more
04-18-2016
08:19 AM
|
0
|
0
|
5751
|
|
POST
|
Hello everyone, I am using this line of code to open up an mxd file: os.startfile("c:/chris/{0}/{0} - existing_proposed.mxd".format(string)) It works and opens the file, but it opens in a new instance of ArcMap. Is there a way to have it open in the instance that is already open? Thanks, Chris
... View more
04-18-2016
07:53 AM
|
0
|
15
|
11301
|
|
POST
|
Thanks Curtis! I first tried arcpy.Copy_management() and was able to get it working but my efforts to get it to use the parameter so the destination could change based on the user input failed. So then I tried shutil.copytree() and it looks like it works: shutil.copytree("x:/GIS/LUAM/DEV/TEMPLATE/data_for_item.gdb","c:/chris/{0}/data_for_item.gdb".format(string)) Have a good weekend.
... View more
04-15-2016
03:06 PM
|
1
|
0
|
3693
|
|
POST
|
So I have the above code working to copy multiple files, but it doesn't work to copy a file geodatabase. Any suggestions for how to do this? Thanks very much for all the help, Chris
... View more
04-14-2016
10:02 AM
|
0
|
2
|
3693
|
|
POST
|
Thanks again for the help Curtis, this is super. Also thanks for the link!
... View more
04-13-2016
07:17 AM
|
0
|
3
|
3693
|
|
POST
|
Thanks Curtis, following your advice I was able to get the copy file working using: If I wanted to modify the code block to first create a folder with the same name as what is appended to the copied CitizenComments.mxd file what would need to be changed? So for example the new file path would be C:\chris\105\105CitizenComments.mxd I had tried the following based on the previous copy file code, but obviously I'm missing some stuff: import os
import shutil
def CopyFile(string):
os.mkdir("c:/chris/{}.format(string))
shutil.copy("c:/chris/Test1/CitizenComments.mxd",
"c:/chris/{}/{}CitizenComments.mxd".format(string))
return "c:/chris/{}/{}CitizenComments.mxd".format(string)
... View more
04-12-2016
02:52 PM
|
1
|
5
|
3693
|
|
POST
|
Thanks Darren. I'll play around with your suggestions. Have a good weekend. Chris
... View more
04-08-2016
03:27 PM
|
0
|
0
|
613
|
|
POST
|
Hi all, I have a very simple python script to copy a file from one location to another: import shutil shutil.copy("c:/chris/Test1/CitizenComments.mxd" , "c:/chris/test2/CitizenComments.mxd") If I take this script and put it in a model builder model, what change would I have to make to the code so that I could have a parameter in the model where a user could enter an index string to be appended to the front of the file name? Thanks! Chrs
... View more
04-08-2016
03:07 PM
|
0
|
11
|
7914
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-10-2020 03:34 PM | |
| 1 | 02-23-2021 11:53 AM | |
| 1 | 02-16-2021 09:15 AM | |
| 1 | 12-10-2020 07:46 AM | |
| 1 | 01-18-2019 09:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-22-2021
04:31 PM
|