|
POST
|
There is the kicker. The ArcPy stuff. That was what I was afraid of when it came to allowing Non-GIS Users to use the Python scripts to query GIS data without having ESRI software installed. Any kind of work-around, besides installing Python on their computer?
... View more
07-17-2020
01:06 PM
|
0
|
3
|
2657
|
|
POST
|
Thank You for the reply Dan. However, I think maybe I wasn't completely clear. My goal is to have the End-User open the python script (lets say in an .EXE file) that is not a GIS user, has no GIS software on their computer but can benefit from the construction of the script to obtain GIS information. I would like to put the script (Without ESRI or Python) on my engineer's computer and all they need to do is double-click the executable file, enter the Meter Number and the script returns a series of values.
... View more
07-17-2020
12:56 PM
|
0
|
5
|
2657
|
|
POST
|
Good Afternoon: I have been experimenting with a series of Python Scripts that utilize the ArcPy SearchCursor feature that has user input (Enter Meter Number) and the script prints the XFMR, Protective Device and Feeder. This first start out as an experiment to learn more about writing Python scripts and it began me thinking. What I would like to do is to take the Python Script and allow others (Non-GIS Users) within my company to use the script. This way, if a user (Engineer, foreman, etc) has a meter number but wants to know the Upstream Protective Device, they can open the script, enter the meter number and get the return value they need. Keep in mind, these users have NO GIS software (ArcDesktop, Python, etc) and simply just viewers. Is this something that is possible to convert a Python script to an executable file for Non-GIS users? If so, how do I start. If I can get it to work, it will open up many possibilities and new query scripts I can build and provide to company users that need to research specific information. Appreciate it.
... View more
07-17-2020
12:25 PM
|
0
|
8
|
2726
|
|
POST
|
Good Afternoon: I believe what I am asking if an elementary level Python code. However, my intention is to run thru a File GDB Feature Class to identify a value from a different field in the same row. Basically, looking for the User to add the value from the field "TWACS_NUMBER" and use the SearchCursor feature to identify the value in the XFMR_BANK_ID field of the same row. I have figured out the User Input portion of the script, but the SearchCursor feature is giving me a hard time with too many example online. Any starting points would help. Thank You
... View more
07-16-2020
02:47 PM
|
0
|
1
|
804
|
|
POST
|
BINGO!! Only one thing I changed in the code: if flag ==0 This made the spaced go away. When there was a "1", it kept including the spaces. Appreciate your help
... View more
06-26-2020
11:11 AM
|
0
|
1
|
7935
|
|
POST
|
Thank You Mehdi: Looks like we are almost there, however: with open(outfile,'w', newline='') as f: is giving me this: TypeError: 'newline' is an invalid keyword argument for this function Not sure what that means. If I replace this line with what you had in the original script: with open(outfile,'w') as f: The script works, BUT still has spaces between the rows.
... View more
06-26-2020
09:36 AM
|
0
|
3
|
7935
|
|
POST
|
Joshua: I appreciate your feedback. I will take a look at what you recommended. Regarding the AddMessage, its not in the code because I am not really sure how to write/include it. With each .PDF created, I would like a message displayed saying something along the lines of file created and the file name.
... View more
06-25-2020
12:02 PM
|
0
|
3
|
1645
|
|
POST
|
env.workspace = r"Y:\MEWCo GIS System - LOCAL\ELECTRIC SYSTEM\ELECTRIC DATASET\MEWCo ELECTRIC SYSTEM\MEWCo ELECTRIC SYSTEM.gdb"
table = "ELECTRIC_METER_READING_F1FEEDER_RC30"
list = []
rows = arcpy.SearchCursor(table)
for row in rows:
list.append(row.SERVICE_IDENTIFIER) # Double
del row, rows
# Remove duplicates from list
list = dict.fromkeys(list)
list = list.keys()
for n in list:
arcpy.TableSelect_analysis(table, r"in_memory\table_sel", "SERVICE_IDENTIFIER = " + str(n)) # Double
# Get TWACs_Number value
for row in arcpy.SearchCursor(r"in_memory\table_sel"):
SERVICE_ADDRESS = row.getValue("SERVICE_ADDRESS") # String
out_graph_name = n
out_graph_pdf = r"Z:\Operations\Maps and Records\GeoDatabase\MEWCO GIS System\GIS Attachments\Electric System\Electric Usage Demand Graphs\F1 Feeder ALL" + "\\" + str(n)[:-2] + ".pdf"
input_template = r"Y:\MEWCo GIS System - LOCAL\ELECTRIC SYSTEM\ELECTRIC GRAPHS - CONSTRUCT\GIS Graph Temps\ELECTRIC METER DEMAND - UPDATED 2020.grf"
input_data = r"in_memory\table_sel"
... View more
06-25-2020
11:25 AM
|
0
|
5
|
1645
|
|
POST
|
I am working on fine-tuning my collection of Python Scripts and one thing I want to do is to add the AddMessage feature to my script. I have a particular script that produces a series of .PDF Graphs from a SearchCursor function. What I want to be able to do is each time an individual .PDF is created, I want to use the built-in SearchCursor with AddMessage to print a message to the screen showing the name of the .PDF created. Here is a portion of my script. list = [] rows = arcpy.SearchCursor(table) for row in rows: list.append(row.SERVICE_IDENTIFIER) # Double del row, rows # Remove duplicates from list list = dict.fromkeys(list) list = list.keys() for n in list: arcpy.TableSelect_analysis(table, r"in_memory\table_sel", "SERVICE_IDENTIFIER = " + str(n)) # Double # Get TWACs_Number value for row in arcpy.SearchCursor(r"in_memory\table_sel"): SERVICE_ADDRESS = row.getValue("SERVICE_ADDRESS") # String out_graph_name = n out_graph_pdf = r"Z:\Operations\Maps and Records\GeoDatabase\MEWCO GIS System\GIS Attachments\Electric System\Electric Usage Demand Graphs\F1 Feeder ALL" + "\\" + str(n)[:-2] + ".pdf" input_template = r"Y:\MEWCo GIS System - LOCAL\ELECTRIC SYSTEM\ELECTRIC GRAPHS - CONSTRUCT\GIS Graph Temps\ELECTRIC METER DEMAND - UPDATED 2020.grf" input_data = r"in_memory\table_sel" Thank You
... View more
06-25-2020
10:15 AM
|
0
|
8
|
1719
|
|
POST
|
Mehdi: Thank You for the assistance. Looks like we are almost there. Here are (2) issues that I am having. I hate to be picky but if the .CSV file is not 100% correct, the database that loads it will fail the upload process. When I open the .CSV in Microsoft Excel, the export adds a separate field, I assume its the ESRI automatic OID number (might be mistaken on the field name). The other problem is between each line, there is a space. I know for a fact having the space between each row will force the upload process to fail. Here is a clip of what the .CSV file looks like after opening it in Excel. Any other advice on these (2) items and I should be in good shape. Thank You again.
... View more
06-25-2020
08:58 AM
|
0
|
0
|
7935
|
|
POST
|
I've built a Pythons script the organizes a dataset that is used for an external database and exported it from a File Geodatabase to a .CSV file. The last part of the workflow is to manually delete the header row and copy the CSV to a network drive and override the existing .CSV file. Now, its been requested to make the workflow 100% automatic and have it built into my current Batch File collection to run each night. Just (2) pieces of the script I cannot figure out how to write: 1) Export File GDB Table to .CSV file WithOut the Header Row 2) When the .CSV file is exported, it Overrides the existing file in it's place with the same name. Any assistance, would be appreciated. Thank You
... View more
06-24-2020
03:22 PM
|
0
|
8
|
8083
|
|
POST
|
Greetings: For the past few years, I have been trying to convince my company to move away from the Tape Measure, Pen and Paper style of doing Utility As-Builts (Electric and Water) and move to collecting GPS points for new infrastructure and service(s) that we install using a GPS receiver and our current Trimble Nomad field data collection device. As of now, I have had very little luck in convincing them that this would be a benefit to our company and my GIS database. What I would like is to see if there are other companies out there that are using a GPS Receiver and some kind of mobile hardware to collect Field As-Builts, specifically in the electric and water utility industry that I could get some advice and feedback on how it has benefited their field As-Built collection workflow. My goal is to be able to collect new infrastructure installation data (Valves, meters, end-points of mainlines, building corners, etc) via GPS coordinates at a very high accuracy and append the newly collected data into my overall dataset. However, as I mentioned before, convincing the decision makers is becoming a challenge and I need some assistance. Any advice or assistance in helping me achieve my goal(s), would be great. Thank You
... View more
01-30-2020
03:28 PM
|
0
|
1
|
1285
|
|
POST
|
Thank You for your help. I will do some more research to see how it may help some of my other scripts.
... View more
12-03-2019
12:40 PM
|
1
|
0
|
4737
|
|
POST
|
Thank you for the revision. That did the trick. So I can understand and possibly implement it into other scripts, how does putting the .upper() into the code block work? Are there other things that I can add in it's place for other variables and/or circumstances?
... View more
12-03-2019
12:28 PM
|
0
|
2
|
4737
|
|
POST
|
Thank you for the response. However, the code didn't seem to work. I copied it to my python script to replace the existing and ran the script. Got a response that said: NameError: name 'upper' is not defined
... View more
12-03-2019
11:50 AM
|
0
|
5
|
4737
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-23-2026 10:58 AM | |
| 1 | 11-20-2025 02:52 PM | |
| 1 | 10-30-2025 12:42 PM | |
| 1 | 10-16-2025 10:51 AM | |
| 1 | 08-27-2025 08:47 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|