|
POST
|
Ok. I haven't tried adding a python addin tool to pro just yet since I would like to be able to create the kind of tools needed for both the model that I am working on as well as other things.
... View more
09-18-2019
05:39 AM
|
0
|
0
|
3963
|
|
POST
|
The other thing is that I would like to get to the point where I can script well enough in python to be able to fully utilize the python addin tool. I discovered this a year or to ago and I was really intrigued with how easy it was to create an addin tool simply using python. The other thing people have mentioned to me as well is the arcobjects for visual studio(which I would also like to learn eventually) simply because the idea of a greater level of flexibility would make simple or complex tasks seem seamless. So there is a lot that I would like to utilize, in addition to python, to further enhance my skill set. I am currently working on a complex 3D model using Microstation, CityEngine, and ArcPro. I would like to eventually create tools to go along with that model. I am still in the design phase but once everything is set up, I hope to eventually enhance the model further.
... View more
09-17-2019
07:56 PM
|
0
|
2
|
3963
|
|
POST
|
I came to that conclusion about a week ago when I was tasked with a simple assignment that, to my knowledge, they had been doing by hand for several years. I had done this task by hand just to learn the workflow and after a couple of times, I realized that this process could easily be rendered seamless if I could simply create something (either python script, modebuilder, or both) that would convert an elongated methodology and simplify it. The other thing is that I have been trying to get the scripts that I have created so far to work in process in modelbuilder. The reason being is that if either I or someone else wanted to use it, it wouldn't be confined to whatever parameters I set up in the script. For some projects that are like this, I have used models most of the time to simplify these tasks. But I realized that some of the tools I need to reach the end result that I wanted, didn't exist, or hadn't been created. So I came to the conclusion that learning python would help fill in the gaps where some of the tools weren't provided or created. But I also realized that some of the python processes I was lacking, and so I don't have quite a solid foundation on most of those. I understand basics like classes, modules, simple scripts, some loops(could probably use more practice with those) and many other things<---like 98.99% of those things My friend and I had practiced python before, and I even took a class on it. Unfortunately we were using the Esri python book, which made little to no sense, and lacked anything in terms of understanding the principles and such. I would like to eventually get to the point where I can I can comfortably create scripts that would get to the result(s) that I picture. So I will keep trying and practicing, and do my best to not get lost since I had little to no understanding on how much a person could really accomplish just using python alone. Thanks for your help Jeremy, and everyone who continues to give wisdom and guidance -Robert
... View more
09-17-2019
06:04 PM
|
0
|
4
|
3962
|
|
POST
|
Thanks Pavan, I won't worry about making changes. I'm still trying to get a better understanding of how the scripting in python affects the behavior of the overall script, and how this can change the overall outcome of the desired result. The other thing that I'm still trying to grasp, that I simply don't fully understand at this point, is the direction. I know what I would like for my end result to be at times, but getting there via scripting is more challenging. I'm really familiar with modelbuilder and I can create most tools from simple models. I realized that the end result that I want to get to is sometimes missing with the given esri tools. I realized that I could fill in for those missing pieces by creating script tools to fill in those gaps, or simplify long drawn out models by simplifying them to scripts. I arrived to the conclusion that I might need to practice more and get familiar with the basics. It's just that there's more to python than I originally thought, and there's other components that I was unaware of. So this is going to take time, but I would like to eventually get to the point that I can understand these things well enough that I won't get lost in the process. Any advice on this would be heavily appreciated. - Robert
... View more
09-17-2019
05:34 PM
|
0
|
0
|
2671
|
|
POST
|
Thanks Pavan. I didn't write that portion of the script, somebody else did and so I used it to test the script and it worked. I know that with the cursors you have to use .da. I didn't know that os.walk also needed the .da as well. I will be sure to remember that.
... View more
09-17-2019
09:58 AM
|
0
|
2
|
2671
|
|
POST
|
Hi, I know this is a very simple question, but I know some python to understand some of the basics and I was wondering what would be the best possible solution, or direction, for studying python. I still struggle with small scripts from time to time, with very small number of them actually working the way I intended. So I just wanted to see if anyone has any suggestions on how to go about this. The other thing is I came across other sites and other sources of python examples that I would eventually like to be at or close to the level of a novice python developer. Eventually I would like to expand on that even further, but as of now I can handle small scripts here and there and so I am starting out low and slow. Here are somethings that I came across that I would like to know more about and be able to understand and utilize. Any of the Esri breakdowns for tools and such 10. API Reference — Python 2.7.16 documentation tkinter — Python interface to Tcl/Tk — Python 3.7.4 documentation
... View more
09-17-2019
05:34 AM
|
2
|
13
|
6270
|
|
POST
|
Thanks Pavan, I checked with one of my coworkers on this and he walked me through a process that you mentioned. Here is the script that he gave me as well as my own additions(mostly his). import os
path = r"C:\Folder\FolderName"
files = []
for r, d, f in os.walk(path):
for file in f:
if '.mdb' in file:
files.append(file)
for f in files:
##print(f)
strip = os.path.basename(file).rstrip(os.path.splitext(file)[1])
print strip This solution was what I was actually trying to get to but, with my knowledge of python being so limited, I don't have a firm grasp on it. I meet with a friend every now and then to study python, but there is more to python than I can feasibly grasp. -Robert
... View more
09-17-2019
05:18 AM
|
0
|
4
|
2671
|
|
POST
|
Ok. Because for some reason I am able to parse the path using modelbuilder and it returns the correct record. The only issue I have with using the script in modelbuilder is that I receive an error message stating the table either does't exists or it simply doesn't open. I have a slightly more dumbed down version of the model that works but I my end goal is to use the script in process with the model which would make this process more seamless. Otherwise the model and script combination that is working currently, works as two separate model tools. So I am simply trying to figure out the best approach to make two processes work as one.
... View more
09-16-2019
12:52 PM
|
0
|
0
|
2671
|
|
POST
|
Hey James, So I tested your script and it works but it populates the table with 20+ records, and so I am wondering if there is a way for me to have the table records update based on the number of files added. So if I add 3 files, then the tool adds 3 records to the table with the file names. I am really close to getting where I want to be and so I am working on this little tiny detail. Thanks, Robert
... View more
09-16-2019
10:24 AM
|
0
|
1
|
4945
|
|
POST
|
Thanks James, I was trying to make sense of the parse path script and loop. I am vaguely familiar with loops but the parse path script form the esri documentation wasn't making much sense to me. The reason I was trying to utilize the Make Table View script is because when I ran the script in process within a model, I would receive an error stating the item cannot be opened or it does not exist. I think this link that I was utilizing might have been adding my confusion but I could be wrong. Parse Path—Help | ArcGIS for Desktop I am trying to get a better understanding on how python works in terms of context and flow. I have several scripts that I have created that work the way I intended, but when I start to get into developing more complicated script, I start to get a bit confused. Huge thanks for your help James -Robert.
... View more
09-16-2019
08:31 AM
|
1
|
0
|
4945
|
|
POST
|
Thanks Johannes. I did manage to get the script working, however, I get an empty output when I run the tool and so I am not sure what I am doing wrong exactly.
... View more
09-16-2019
07:21 AM
|
0
|
0
|
4945
|
|
POST
|
I never used the code formatting before so it's new to me.
... View more
09-16-2019
06:54 AM
|
0
|
0
|
4945
|
|
POST
|
Hi, i am relatively new to python but I am trying to work on a script that works in conjunction with modelbuilder and so far things were working up to a point. The issue that I am having is I am trying to loop through a list of files, get the filenames, and update a table with the names from the files. Here is the script that I have currently: import arcpy
import os
#Set Parameters
inFiles = arcpy.GetParameterAsText(0)
inTable = arcpy.GetParameterAsText(1)
inField = arcpy.GetParameterAsText(2)
outTable = arcpy.SetParameterAsText(3)
#Iterate through files in folder, insert rows based on file names, and make table view layer
with arcpy.da.InsertCursor(inTable, inField) as cursor:
#List Files
flist = arcpy.List(inFiles)
for f in flist:
#Make table view
arcpy.MakeTableView_management(inTable)
#Get filename(s)
f = os.path.basename(flist).rstrip(os.path.splitext(flist)[1])
#Insert values and rows in table
cursor.insertRow([f])
del cursor
#Add Message
arcpy.AddMessage("This row {0} was added.".format(f)) Any help on this would be greatly appreciated.
... View more
09-16-2019
05:47 AM
|
0
|
23
|
10240
|
|
POST
|
Hi, So I am working on a model where for every database, there is a feature class that gets selected, the count is taken for that feature class, and that populates a field in a table. This model runs for every row in a designated table. But what I am trying to accomplish is : for each record in table run model to get the feature class in the database, get the count for that feature class, and calculate the count in the table. When this model runs once, run the model for the next record in the table this process repeats for every table record and every database.
... View more
09-13-2019
06:31 AM
|
0
|
6
|
2090
|
|
IDEA
|
The other thing that I am hoping for is for community users to be able to directly incorporate any custom creations in AGO and/or tools in ArcCatalog without having to directly download and/or install. Kind of like having a separate page for community users.
... View more
09-10-2019
05:23 AM
|
0
|
0
|
1373
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-07-2026 01:36 PM | |
| 1 | 02-10-2026 06:09 AM | |
| 1 | 03-04-2026 01:08 PM | |
| 1 | 02-24-2026 12:59 PM | |
| 3 | 03-03-2026 10:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|