Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sr = arcpy.SpatialReference (...spatial reference info...) #spatial reference object
- moveLyr = "SnapToMeLayer" #layer to be snapped to edge or vertex
- class MoveLeak (object):
- def onMouseUpMap(self, x, y, button, shift):
- point = arcpy.Point (x, y)
- clickGeom = arcpy.Geometry ("POINT", point, sr)
- arcpy.CreateFeatureclass_management ("in_memory", "pnt", "POINT",
- spatial_reference = sr)
- tempPntFc = r"in_memorypnt"
- with arcpy.da.InsertCursor (tempPntFc, "SHAPE@") as curs:
- curs.insertRow ((clickGeom,))
- #snap 6 feet distance used to allow wiggle room with click
- arcpy.Snap_edit (tempPntFc, [[moveLyr, "EDGE", "6 FEET"]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement