POST
|
Dan, ArcMap is 10.6.1.9270 and I am showing build number 997 for Production Mapping. V/R, Forbes
... View more
08-28-2019
12:30 AM
|
0
|
1
|
855
|
POST
|
Hi Dan, Thank you for looking into this and helping me out! You wrote: "When I open ArcMap and launch the Python window ..." The issue I am facing is that the LoadData_production function is not being recognized when called outside of ArcMap. When I run the code from an ArcMap Python window it runs fine -- I am trying to run my script from the command line/IDE, that way I can have the script execute while I am not physically present. Here is my code in its entirety without any truncation for expediency -- import arcpy
class LicenseError(Exception):
pass
try:
if arcpy.CheckExtension("Foundation") == "Available":
arcpy.CheckOutExtension("Foundation")
else:
raise LicenseError
crossReference = r"C:\Temp\dataloadTest\dataload_crossref.mdb"
sourceDatabase = r"C:\Temp\dataloadTest\dataLoad_source.gdb"
targetDatabase = r"C:\Temp\dataloadTest\dataLoad_target.gdb"
logRowErrs = "ROW_LEVEL_ERROR_LOGGING"
arcpy.LoadData_production(crossReference, sourceDatabase, targetDatabase,
"#", logRowErrs)
except LicenseError:
print "Production Mapping License unavailable."
except arcpy.ExecuteError:
print(arcpy.GetMessages(2))
To reiterate - when I execute this in ArcMap it runs perfectly fine. However, my goal is to have this run from the command line via a scheduled task during off hours. When executed from IDLE for example (or your superior IDE of choice) it fails to recognize arcpy.LoadData_production entirely. I suspect when I import arcpy from outside of ArcMap something is failing to instantiate, or something different happens when you import arcpy from inside of ArcMap.
... View more
08-26-2019
05:23 PM
|
0
|
3
|
855
|
POST
|
I am attempting to use the Production Mapping Data Load tool to copy data from one database into another with a differing schema. Something I've done manually several times, but would prefer to script it out to save some time. Unfortunately I've run into some issues, and was hoping someone may point me in the right direction. Code Sample: import arcpy
try:
if arcpy.CheckExtension("Foundation") == "Available":
arcpy.CheckOutExtension("Foundation")
else:
raise LicenseError
arcpy.LoadData_production(crossReference, sourceDatabase,
targetDatabase, logRowErrs)
except LicenseError:
"Production Mapping License unavailable"
Returns: AttributeError: 'module' object has no attribute 'LoadData_production' It is worth mentioning this is the result when I execute the code from a *.py - when I copy and paste the code into an ArcMap Python window it runs fine. I would appreciate any guidance! V/R, Forbes
... View more
08-25-2019
07:44 PM
|
0
|
5
|
1388
|
POST
|
Thank you very much! I am currently using Use WAB Developer Edition 1.2. I appreciate your response. Regards, Forbes
... View more
09-11-2015
05:23 AM
|
0
|
0
|
254
|
POST
|
Hello! So I am new to the Web AppBuilder and I am currently playing around with the idea of exporting a map from ArcGIS Online into it. The Query widget is especially attractive because it appears I can predefine a series of queries that a user would use - which is absolutely fantastic! However I've run into a problem where it's not recognizing non-spatial tables. I have a non-spatial table related to a bunch of different layers via IDFKs - is there something I am overlooking or does anybody know of a custom widget I can use to query standalone tables from inside Web AppBuilder? Thanks in advance! Forbes
... View more
09-10-2015
08:52 AM
|
0
|
2
|
2966
|
POST
|
Tony, Not sure if you're still looking for a solution since it's been a while since this thread has been touched but it came up in my searches and I would like to offer a solution so that folks in the future can see it too. I was able to get around this issue by writing a separate script, saving it as a .pyw (thus forcing pythonw.exe to read it, rather than python.exe) and then importing it as a 'library' into my main script. Since I am at the moment writing a Python Add-in for Arc Catalog I'll use that as an example. First you write the code that gives you your window/app/etc #!/usr/bin/python
#wxWorkAround.pyw
import wx
# This just gives up a blank, re-sizable window.
def main():
app = wx.App()
frame = wx.Frame(None, -1, 'simple.py')
frame.Show()
app.MainLoop() (Lets say you were trying to have a window pop up when you clicked a button in a Python Add In) Save that script as a .pyw and then import it like you would any other script, and then call it like this: class sampleButton(object):
"""Implementation for GRRTool_addin.sampleButton (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
wxWorkAround.main() It has worked for me (at least within ArcCatalog), so I hope this helps somebody in the future.
... View more
09-24-2013
10:06 AM
|
0
|
0
|
455
|
POST
|
Certainly! You would need to go one for loop further. for item in fccl: ..... Then from there you would create the cursor, nest in a while loop, and then do what you need to do. Just be sure to delete the cursor at the end of the loop, that way it creates it and destroys it all within the loop and nothing escapes once its done.
... View more
04-30-2012
09:52 AM
|
0
|
0
|
546
|
POST
|
Hey Meg, I saw this the other day and have been trying to think of a way to do this through Python. I would like to ask a few questions to better understand what you're trying to do and then offer up an idea that just occured to me. How exactly are you tracking these issues? Are they empty fields that get populated and thus having been populated they are considered resolved? If this is the case then I believe I have an idea that might work for you. It wouldn't be as instant, but at the end of an editing session you could run the script and it would update the [STATUS] field accordingly. A script could perhaps check the length each of the three (or however many) fields, if they return 0 (aka empty) the script could set the [STATUS] for that record to 0/unresolved, if one or more of the fields return >0 then it could set the status to 1/in_progress and if all of the fields return >0 then the status could be set to 2/resolved and then the dots can be symbolized by the varrying levels of the status field.
... View more
04-20-2012
07:40 AM
|
0
|
0
|
195
|
POST
|
If you want to just remove parcels from display: Use Identify tool and note IDs or unique numbers of unwanted parcels. Then in Layer Properties -> Definition query tab: build an expression like: [OBJECTID] NOT IN (1,2,3,5) I personally prefer this method, even if I know I'll never need the rest of the data. It is a good habit to get into when you begin working with larger, more permanent datasets. It creates less clutter and requires less steps than creating a whole new feature of just the data you want to display.
... View more
04-20-2012
07:25 AM
|
0
|
0
|
139
|
POST
|
In my experience I've only ever used del to delete a cursor after I was done with it, just to avoid any potential schema locks down the line in the script. If I had to give a hard and fast rule, I would say to delete the cursor when you're done with it - it's better to be safe than sorry and recreate the cursor (say, at the start of a function) every time you need it and then delete it at the end of the function. Otherwise, if I am just writing over a variable I never bother using del because reassignment works just fine.
... View more
04-20-2012
07:19 AM
|
0
|
0
|
241
|
POST
|
I think the issue with the python is that .replace() is a string function and it looks to me like you're trying to apply it to the field name. I don't know for sure without playing with your code, but I imagine that you would need an updateCursor and then set the fieldValue = fieldValue.replace()
... View more
04-20-2012
07:09 AM
|
0
|
0
|
1071
|
POST
|
I think the issue with the python is that .replace() is a string function and it looks to me like you're trying to apply it to the field name. I don't know for sure without playing with your code, but I imagine that you would need an updateCursor and then set the fieldValue = fieldValue.replace()
... View more
04-20-2012
07:05 AM
|
0
|
0
|
1071
|
POST
|
What service pack are you using? If you're still pre 4 you could try updating. Do you have an image service layer? I found evidence that findAndReplaceWorkspacePath will crash if there is an image service layer -- ( http://support.esri.com/en/bugs/nimbus/TklNMDYwMzE1 ) not sure if it is related or if it was ever fix't.
... View more
04-18-2012
10:53 AM
|
0
|
0
|
473
|
POST
|
Does it hard crash or does it provide you with some kind of error?
... View more
04-18-2012
09:50 AM
|
0
|
0
|
473
|
POST
|
you've got to isolate the field names with [brackets] and you don't need to include the POPQSMile = I am pretty sure you just need to put expression = "[POPULATION] / [SQMILE]"
... View more
04-18-2012
09:41 AM
|
0
|
0
|
289
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|