# Name: Enable_Referent_Fields_ex1.py
# Description: Enable referent fields for an existing LRS Event that already has referent fields configured.
# Requires: ArcGIS Location Referencing
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# Local variables:
inputEventFC = r"c:\EnableReferent\Py\EnableReferent.gdb\LRS"
fromReferentMethodField = 'FromRefMethod'
fromReferentLocationField = 'FromRefLocation'
fromReferentOffsetField = 'FromRefOffset'
toReferentMethodField = 'ToRefMethod'
toReferentLocationField = 'ToRefLocation'
toReferentOffsetField = 'ToRefOffset'
offsetUnit = 'FEET'
# Execute the tool
arcpy.locref.EnableReferentFields(inputEventFC, fromReferentMethodField, fromReferentLocationField,
fromReferentOffsetField, toReferentMethodField, toReferentLocationField,
toReferentOffsetField, offsetUnit)
# Check in license
arcpy.CheckInExtension('LocationReferencing')