Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import arcpy module
- import arcpy
- arcpy.env.workspace = "C:UsersJackDesktopGISBackupParcel.gdb"
- arcpy.env.overwriteOutput = True
- # Script arguments
- Input_Feature_Class = arcpy.GetParameterAsText(0)
- if Input_Feature_Class == '#' or not Input_Feature_Class:
- Input_Feature_Class = Parcel_Selected
- # Local variables:
- SplitLines = arcpy.GetParameterAsText(1)
- if SplitLines == '#' or not SplitLines:
- SplitLines = "ParcelWithLabel"
- # Process: Split Line At Vertices
- arcpy.SplitLine_management(Input_Feature_Class, SplitLines)
- # Process: Delete Identical
- arcpy.DeleteIdentical_management(SplitLines, "shape", "", "0")
- # Process: Show Labels
- mxd = arcpy.mapping.MapDocument("CURRENT") #Map document reference
- dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0]
- addLayer = arcpy.mapping.Layer(SplitLines)
- arcpy.mapping.AddLayer(dataFrame, addLayer)
- layer = arcpy.mapping.ListLayers(mxd, "")[0]
- if layer.supports("LABELCLASSES"):
- for lblclass in layer.labelClasses:
- lblclass.showClassLabels = True
- lblclass.expression = '"{}" & round([Shape_Length],2) & "{}"'.format("<FNT name='Arial' size='12'>" , "</FNT>")
- layer.showLabels = True
- arcpy.RefreshActiveView()
- mxd = arcpy.mapping.MapDocument("c:/myMXDs/project1/thing.mxd")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement