|
POST
|
@jcarlson , would you have any knowledge as to how to treat labeling an address with the same description based on the code snippets from above. Below, if a feature is a business, I am trying to label the building number only, not the situs number if a building number exists. In the same scope of work, I am also trying to label a business on the unit number only if a unit number exists. }else if(d == 'BUSINESS'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'BUSINESS'){
if(IsEmpty(b)){
return s}
else{
return b}
}
... View more
04-26-2021
01:56 PM
|
0
|
0
|
3804
|
|
POST
|
Thank you both for your assistance on this, greatly appreciated.
... View more
04-26-2021
08:43 AM
|
0
|
0
|
3842
|
|
POST
|
So when I enter that, it shows that there is a reserved keyword on line 10. else{
... View more
04-26-2021
08:13 AM
|
0
|
3
|
3875
|
|
POST
|
Thanks, Josh, To clarify, I am looking to label the Situs Number of the address where the description of the address is single. We label different addresses in different ways that we are trying to convert from VB Script into Arcade. The example below shows how we labeled single addresses, then how we labeled duplexes in the same label class. Function FindLabel ([Description], [SitusNum], [BuildingNum], [UnitNum])
myDescrip = [Description]
myBldgVal = [BuildingNum]
myUnitVal = [UnitNum]
Select Case myDescrip
Case "SINGLE"
FindLabel = [SitusNum]
Case "DUPLEX"
if isNull(myUnitVal) or myUnitVal = "" or myUnitVal = " " then
FindLabel = [SitusNum]
else
FindLabel = [SitusNum] & " - " & [UnitNum]
... View more
04-26-2021
08:01 AM
|
0
|
5
|
3881
|
|
POST
|
I am trying to label a feature based on if it is in particular criteria. There are address points where we want to label the Situs Number (SitusNum) based only if the Description of the address is 'SINGLE'. The code below is obviously basic but I am wondering how I can apply a when or if statement to below. We will be using multiple expressions in the same label class, so applying a SQL filter will not be enough. $feature.SitusNum SQL Statement to make it so it labels only where the description is NULL: Description = 'SINGLE'
... View more
04-26-2021
07:43 AM
|
0
|
8
|
3889
|
|
POST
|
In trying to upgrade code from Python 2 to 3, the below code broke for a calculate field that functioned in 2.x. I tried putting double quotes around the (' & ') based on some searching, but did not do the trick. !FullName!.split(' & ')[1].split('/')[0] The error is: ERROR 000539: Traceback (most recent call last): File "<expression>", line 1, in <module> IndexError: list index out of range Failed to execute (Calculate Field (4)).
... View more
04-05-2021
11:02 AM
|
0
|
3
|
1699
|
|
IDEA
|
Our organization is migrating SDE Python routines from Python 2.x to Python 3.x that run nightly on a SQL Server machine. In this migration process, we discovered that database replication from ArcGIS Pro (Python 3.x) does not support replicating geometric networks. We had to create a workaround of deleting the GN into the child database, then copy features from parent to child database. While we are aware that ArcGIS Pro can only view and not edit geometric networks and that utility networks are the next step, many organizations will be using geometric networks for a while as it will take years to migrate over to the utility network. It would be nice if Python 3.x can function with replicating geometric networks. My understanding it was not until ArcGIS Pro 2.5 or 2.6 that database replication was even available in ArcGIS Pro.
... View more
03-20-2021
10:45 AM
|
0
|
0
|
1032
|
|
POST
|
In trying to migrate from 2.x to 3.x, I am trying to update a segment of code and my troubleshoot has ran its limits with Google. I am trying to remove domains from fields in various feature classes below. My error, in particular, comes from the image below where the error I get is the 'NoneType' object is not callable. Full Code: # Comments
arcpy.AddMessage("Removing All Domains..." +'\n')
txtFile.write("Removing All Domains..." +'\n')
#Set workspace environment to geodatabase
arcpy.env.workspace = "D:\\WorkSpace\\WebReporter\\Workspace.gdb"
myGDB = "D:\\WorkSpace\\WebReporter\\Workspace.gdb"
#Get list of feature classes in geodatabase
FCs = arcpy.ListFeatureClasses()
#Loop through feature classes in list
for FC in FCs:
#List fields in feature class
fields = arcpy.ListFields(FC)
#Loop through fields
for field in fields:
#Check if field has domain
if (field.domain != "" and field.domain != 'EnabledDomain' and field.domain != 'AnnotationStatus'):
#Print feature class, field, domain name
print (FC, field.name, field.domain)
arcpy.RemoveDomainFromField_management(FC, field.name)
# Get domains that are assigned to a field
domains_used = []
for dirpath, dirnames, filenames in arcpy.da.Walk(myGDB, datatype=["FeatureClass", "Table"]):
for filename in filenames:
print ("Checking {}".format(os.path.join(dirpath, filename)))
## Check for normal field domains
for field in arcpy.ListFields(os.path.join(dirpath, filename)):
if field.domain:
domains_used.append(field.domain)
## Check for domains used in a subtype field
# Comments
arcpy.AddMessage("I got to here..." +'\n')
txtFile.write("I got to here..." +'\n')
subtypes = arcpy.da.ListSubtypes(os.path.join(dirpath, filename))
for stcode, stdict in subtypes.items():
if stdict.get('keys')()()("SubtypeField") != u'':
for field, fieldvals in stdict.get('keys')("FieldValues").items():
if not fieldvals[1] is None:
domains_used.append(fieldvals[1].name)
# Get domains that exist in the geodatabase
domains_existing = [dom.name for dom in arcpy.da.ListDomains(myGDB)]
# Find existing domains that are not assigned to a field
domains_unused = set(domains_existing) ^ set(domains_used)
print ("{} unused domains in {}".format(len(domains_unused), myGDB))
for domain in domains_unused:
arcpy.DeleteDomain_management(myGDB, domain)
print ("{} deleted".format(domain) )
# Comments
arcpy.AddMessage("Removing All Domains Complete..." +'\n')
txtFile.write("Removing All Domains Complete..." +'\n')
... View more
03-19-2021
11:42 AM
|
0
|
1
|
904
|
|
POST
|
We are using a custom VB add-in tool in ArcMap to record transactional history for updates to our Address feature class. Example: 105 Main St was entered incorrectly 3 years ago. The editor updates to the correct information, which is 110 Main St. In the SQL table, the table stores the unique ID of the address, the old address (105 Main St), the new address (110 Main St), the update time, and editor using Windows authentication. We are trying to migrate this custom add-in tool in ArcMap to attribute rules with arcade expressions into ArcGIS Pro. The question I have is can anyone point me towards a resource for recording in a separate table edits to a feature class recording the attribute value prior to the edit and what the new value is.
... View more
01-26-2021
07:56 AM
|
0
|
3
|
2739
|
|
POST
|
I have a script from an ArcMap toolbox that updates text elements in the MXD as user input parameters below. I am trying to update this to work in Pro, but I am having trouble finding resources. I have tried updating certain codes in the second snippet below with text in bold. Original: import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") # Defines Address Element Name SiteName = arcpy.GetParameterAsText(0).upper() Address = arcpy.GetParameterAsText(1).upper() PreplanID = arcpy.GetParameterAsText(2).upper() CrossStreet = arcpy.GetParameterAsText(3).upper() Floor = arcpy.GetParameterAsText(4).lower() # Autopopulate Remaining Text Elements from User Inputs and Cursor search for elm in arcpy.mapping.ListLayoutElements(mxd,"TEXT_ELEMENT"): if elm.name == 'SiteName': elm.text = SiteName elif elm.name == 'Address': elm.text = Address elif elm.name == 'PreplanID': elm.text = PreplanID elif elm.name == 'CrossStreet': elm.text = CrossStreet elif elm.name == 'Floor': elm.text = Floor Failing update: import arcpy aprx = arcpy.mp.ArcGISProject("CURRENT") # Defines Address Element Name SiteName = arcpy.GetParameterAsText(0).upper() Address = arcpy.GetParameterAsText(1).upper() PreplanID = arcpy.GetParameterAsText(2).upper() CrossStreet = arcpy.GetParameterAsText(3).upper() Floor = arcpy.GetParameterAsText(4).lower() # Autopopulate Remaining Text Elements from User Inputs and Cursor search for elm in arcpy.mp.ListLayoutElements(aprx,"TEXT_ELEMENT"): if elm.name == 'SiteName': elm.text = SiteName elif elm.name == 'Address': elm.text = Address elif elm.name == 'PreplanID': elm.text = PreplanID elif elm.name == 'CrossStreet': elm.text = CrossStreet elif elm.name == 'Floor': elm.text = Floor
... View more
01-05-2021
04:18 PM
|
0
|
3
|
2004
|
|
POST
|
The issue I found is that I applied attribute rules and upgraded an annotation feature class to ArcGIS Pro version. I tried updating the RBJ in ArcMap, but once you upgrade to attribute rules and Pro version of annotation, it is not able to read in ArcMap. As a result, I am unable to change the RBJ files now.
... View more
12-23-2020
12:50 PM
|
0
|
0
|
2056
|
|
IDEA
|
I have seen questions on GeoNet about this, but not on the idea board. Is there a plan to allow for the creation or updating of RBJ files in ArcGIS Pro?
... View more
12-23-2020
10:37 AM
|
1
|
3
|
3056
|
|
POST
|
Thank you, Michael, that did work. This will be helpful as we will have parallel Python environments of 2.7.x and 3.x until we can fully migrate to ArcGIS Pro.
... View more
08-31-2020
09:08 AM
|
0
|
1
|
1994
|
|
POST
|
In trying to migrate Python Scripts from ArcGIS Desktop Python 2.7.x to ArcGIS Pro 3.x, we email staff if there is a failure on a routine. Below I am running a sync replica routine using ArcGIS Pro, deliberately breaking it on the file path to the database connection string so it will email a failure. Somewhere in migration, it does not like the email code that has been working for years now. Has anyone else had to upgrade email failures from 2.7.x to 3.x in Python? With using the correct file path, the routine was successful. We use Windows Task Scheduler to run Python routines. I receive the error (server name omitted for security): try:
arcpy.management.SynchronizeChanges(r"C:\Tech_Info\DB_CONX\SERVER\SERVER ParentDatabase user.sde", "ReplicaName", r"C:\Tech_Info\DB_CONX\Server\SERVER ChildDatabase user.sde", "FROM_GEODATABASE1_TO_2", "IN_FAVOR_OF_GDB1", "BY_OBJECT", "RECONCILE ")
except Exception as e:
arcpy.AddMessage("SynchronizeChanges_management ISGIS.ReplicaName Failed..." +'\n')
txtFile.write("SynchronizeChanges_management ISGIS.ReplicaName Failed..." +'\n')
txtFile.write (arcpy.GetMessages() + '\n')
HOST = "host.server.com"
SUBJECT = "Priority: CRITICAL Routine Failure"
TO = "email@python.org"
FROM = "Routine Failure<failure@python.org>"
text = "Routine has failed. Please see log file for detailed information. \n Error Message: \n " + str(e.msg)
BODY = string.join((
"From: %s" % FROM,
"To: %s" % TO,
"Subject: %s" % SUBJECT,
"",
text
), "\r\n")
server = smtplib.SMTP(HOST)
server.sendmail(FROM, [TO], BODY)
server.quit()
... View more
08-27-2020
10:30 AM
|
0
|
3
|
2070
|
|
POST
|
Thank you, Johannes, that did the trick. Your help is appreciated.
... View more
08-18-2020
09:39 AM
|
0
|
0
|
3828
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | yesterday | |
| 1 | Wednesday | |
| 5 | 12-10-2025 03:48 PM | |
| 1 | 12-10-2025 12:19 PM | |
| 1 | 11-13-2025 07:02 AM |
| Online Status |
Online
|
| Date Last Visited |
24m ago
|