# Name: EnableDerivedMeasureFields_ex1.py
# Description: Enables fields to store the derived network route id, route name and measure fields.
# Requires: ArcGIS Location Referencing
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# tool variables
in_feature_class = "c:\\APR.gdb\\LRS\LineEventFeatureClass"
Derived_route_id_field = "DerivedRouteId"
Derived_route_name_field = "DerivedRouteName"
Derived_from_Measure_field = "DerivedFromMeasure"
Derived_to_Measure_field = "DerivedToMeasure"
# Set current workspace
arcpy.env.workspace = "c:\\EnableDerivedMeasureFields\\Py\\APR.gdb\\LRS\\LineEventFeatureClass"
# Execute the tool
arcpy.locref.EnableDerivedMeasureFields(in_feature_class, Derived_route_id_field, Derived_route_name_field, Derived_from_Measure_field, Derived_to_Measure_field)
# Check in license
arcpy.CheckInExtension('LocationReferencing')