IDEA
|
I agree with this, it seems along the same lines of replicating domains, editor tracking, etc. Database Replication should support replication of attribute rules.
... View more
04-27-2021
12:26 PM
|
0
|
0
|
1597
|
POST
|
We have a description field in our address feature class and one of the values is 'BUSINESS'. We have two other fields, Unit Number and Building Number. In working to migrate labeling language from VB Script to Arcade, we would like to label on the following conditions: Applies to all where the description is BUSINESS - If the building number is not null, label the building number and not the situs number. - if the unit number is not null, label the unit number and not the situs number. - If the building and unit numbers are both NULL, label the situs number - Not often, but if both unit number and building number are both not null, label both unit number and building number, do not label situs number Below is the code that I currently am working with. The portion that pertains to my question is where the description is 'BUSINESS'. var d = $feature.Description
var s = $feature.SitusNum
var u = $feature.UnitNum
var b = $feature.BuildingNum
if(d == 'SINGLE'){
return s
} else if(d == 'TOWNHOME'){
return s
} else if(d == 'ACCESSORY DWELLING'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'DUPLEX'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'MANUFACTURED'){
if(IsEmpty(u)){
return s}
else{
return s + ' - ' + u}
} else if(d == 'CONDO'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'MULTIFAMILY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'BUSINESS'){
if(IsEmpty(b)){
return s}
else{
return b}
} else if(d == 'BUSINESS'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'CARE FACILITY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'PRIVATE PARK'){
return s
} else if(d == 'PUBLIC FACILITY'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'GARAGE'){
if(IsEmpty(u)){
return s}
else{
return u}
} else if(d == 'PARKING GARAGE'){
return s
} else if(d == 'STORAGE UNIT'){
if(IsEmpty(u)){
return s}
else{
return u}
}
... View more
04-27-2021
11:47 AM
|
0
|
7
|
19594
|
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
|
1925
|
POST
|
Thank you both for your assistance on this, greatly appreciated.
... View more
04-26-2021
08:43 AM
|
0
|
0
|
1963
|
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
|
1996
|
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
|
2002
|
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
|
2010
|
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
|
942
|
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
|
651
|
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
|
486
|
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
|
1504
|
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
|
1014
|
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
|
963
|
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
|
1902
|
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
|
1032
|
Title | Kudos | Posted |
---|---|---|
3 | 08-15-2023 07:08 AM | |
2 | 07-26-2023 10:03 AM | |
3 | 05-10-2023 03:19 PM | |
1 | 05-02-2019 12:19 PM | |
7 | 12-07-2022 09:08 AM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|