When the parameter is feature class I can filter the input to polyline only. How to do this when the input is layer file at CURRENT MXD? I'm looking for something that will operate before the script starts running. I'm using Layer file so the user can choose the input from the data frame at the current MXD.
try this bit of code within the python window to limit your processing to polyline features only.
mxd = arcpy.mapping.MapDocument("CURRENT") lyrs = arcpy.mapping.ListLayers(mxd) for lyr in lyrs: if lyr.supports("DATASOURCE"): descLYR = arcpy.Describe(lyr.dataSource) if descLYR.shapeType = "Polyline": #do stuff here