The GetNAClassNames method outlined here will help you to grab the LALines: http://pro.arcgis.com/en/pro-app/arcpy/network-analyst/getnaclassnames.htm
Note the link above is for ArcGIS Pro but the process is similar in ArcMap 10.x.
The code reference for LocationAllocation also includes these steps: http://pro.arcgis.com/en/pro-app/tool-reference/network-analyst/make-location-allocation-layer.htm
- Create an object for your LocationAllocation.
- Get the network analysis layer names
- Get the result object sublayer for the lines
- Export using copy features
My example below has combined code from the two links above.
#Create a new location-allocation layer.
result_object = arcpy.na.MakeLocationAllocationLayer(network, layer_name,
impedance,
"DEMAND_TO_FACILITY",
"MAXIMIZE_ATTENDANCE", 3,
5, "LINEAR")
#Get the layer object from the result object. The location-allocation layer
#can now be referenced using the layer object.
layer_object = result_object.getOutput(0)
#Get the names of all the sublayers within the location-allocation layer.
sublayer_names = arcpy.na.GetNAClassNames(layer_object)
#Stores the layer names that we will use later
facilities_layer_name = sublayer_names["Facilities"]
demand_points_layer_name = sublayer_names["DemandPoints"]
lalines_layer_name = sublayer_names["LALines"]
#Get the lalines sublayer from the service area layer
lalinesSublayer = layer_object.listLayers(lalines_layer_name)[0]
# if you want to do in one step instead, skip the lalines_layer_name step above and use the following:
# lalinesSublayer = layer_object.listLayers(sublayer_names["SALines"])[0]
#Export the lalines sublayer as a feature class
output_lines = pathtooutputdestination
arcpy.management.CopyFeatures(lalinesSublayer, output_lines)
EDIT: The syntax is pretty much the same from my quick scan, but just in case I included a link to the 10.x docs for this function. http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-network-analyst/getnaclassnames.htm