Parcel Fabric Active Record Automation

197
0
01-25-2024 09:23 AM
KenGalliher1
Esri Contributor
5 0 197

Released with Pro 3.2 is the ability to read and update the active parcel record in a map containing a parcel fabric.

Using ArcPy CIM Access, this set of properties will allow users to automate:

  • Discovery of a map’s active record.
  • To set a new active record.
  • Activate/deactivate the active record.
  • Toggle the visibility of features in the active record.

The Cartographic Information Model (CIM) provides access to many settings and properties of ArcGIS Pro that may not have a publicly exposed API through the ArcPy.mp module. Starting at Pro 3.2, the CIM now contains the following properties:

Type

Property

Description

Bool

isParcelFabricLayer

Denotes the layer is of type ParcelFabricLayer

String

activeRecord

The GlobalID value of the active record (if set)

Bool

enabled

Is the parcel record set in the current map? (True | False)

Bool

showActiveRecordOnly

Should the map only display features participating in the active record

 

A typical workflow may be:

  1. Access a Pro project and map with arcpy.mp
  2. Determine if a map has a parcel fabric.
  3. If a parcel fabric layer is in the map, determine if there is an active record.
  4. If no active record, set the record with a known GUID of an existing record.
  5. Set the record status to “enabled”.
  6. Optionally, set to display only the parcel features associated to the now active record.

 

 

 

# Full script for Python Window. 
# Replace "CURRENT" with path to target Pro Project to run outside of Pro

# access the project and map
current_project = arcpy.mp.ArcGISProject("CURRENT") 
target_map = current_project.listMaps()[0]
print(target_map.name)

# test the parcel fabric exists by its name
map_layers = target_map.listLayers()
parcel_layer = [lyr for lyr in map_layers if lyr.isParcelFabricLayer][0]

# if the parcel fabric exists, check for the parcelFabricActiveRecord property
if parcel_layer:
    
    # get current CIM object
    parcel_cim_def = parcel_layer.getDefinition("v3")
    
    # if the active record is not set, set it.
    if not parcel_cim_def.parcelFabricActiveRecord.activeRecord:
        # Set the new values
        parcel_cim_def.parcelFabricActiveRecord.activeRecord = "6B1431DA-1D9B-4B69-BD24-79EB643D8C98"
        parcel_cim_def.parcelFabricActiveRecord.enabled = True
        parcel_cim_def.parcelFabricActiveRecord.showActiveRecordOnly = True
        
        # save the CIM definition, save project, open the map (optional)
        parcel_layer.setDefinition(parcel_cim_def)
        current_project.save()
        target_map.openView()

 

 

 

 

About the Author
Product Engineer - Parcel Fabric