Re-creates shapes for event features registered with an LRS Network.
An LRS dataset is required to run this tool. To create an LRS dataset, add the Calibration Point, Centerline, and Redline layers to a feature dataset, and then run the Modify LRS tool with the geodatabase as the input.
Input the event whose features need to be regenerated based on the route and measure of the event.
When conflict prevention is enabled for the tool, any events being generated by the tool will be locked.
| Parameter | Explanation |
|---|---|
| in_event_layer |
The event for which shapes will be regenerated. |
GenerateEvents example 1 (Python window)
The following Python window script demonstrates how to use GenerateEvents in immediate mode.
# tool variables
in_event_layer = "Event"
# set current workspace
arcpy.env.workspace = "C:/data/Outputs.gdb"
# execute the tool
arcpy.UpdateEventShapes_locref(in_event_layer)
GenerateEvents example 2 (stand-alone script)
The following Python script demonstrates how to use GenerateEvents in a stand-alone Python script.
# Name: GenerateEvents_Ex2.py
# Description: Re-creates shapes for event features registered with a LRS Network
# Requirements: ArcGIS Pipeline Referencing
# Import arcpy module
import arcpy
# Check out any necessary licenses
arcpy.CheckOutExtension("LocationReferencing")
# Local variables
# input Network layer
in_event_layer = "C:\\Data\Sample.gdb\\SpeedLimit"
# Process: Generate Events
arcpy.GenerateEvents_locref(in_event_layer)
GenerateEvents example 3 (stand-alone script)
The following Python script demonstrates how to use GenerateEvents in a stand-alone Python script in a feature service.
# Name: GenerateEvents_Pro_Ex3.py
# Description: This script demonstrates how to generate events in stand alone mode using a feature service. It is recommended to work in a version and post it into the default version.
# Requires: LocationReferencing license
# Import arcpy module.
import arcpy
# Check out any necessary licenses.
arcpy.CheckOutExtension("LocationReferencing")
## Input event is in feature service. Signing in portal is required to access the feature service.
arcpy.SignInToPortal('https://yourdomain.com/portal', 'username', 'password')
## Map the input event from the feature service. Here, 3 corresponds to the input event.
in_event_layer = r"https://yourdomain.com/server/rest/services/FeatureServiceName/FeatureServer/3"
# Process : Generate Events.
arcpy.GenerateEvents_locref(in_event_layer)
There are no tags for this item.
There are no credits for this item.
There are no use limitations for this item.