<div></div>Hi all,<br>i have a question for you. I'd like to have a new function in my plugin that makes an autime snapping if a start point or end point of a new feature inserted is closed to a vertex or segment base on a values setted ina configuration file.<br>From plugin console:<br><br>l = iface.activeLayer()  --activeLayer<br>f = l.selectedFeatures()[0] -- new fetaure inserted<br>start = f.geometry().asPolyline()[0] -- get the start point (the point that i would like to snap to a segment)<br>result = l.snapWithContext(start,10,QgsSnapper.SnapToVertexAndSegment) -- i use<br>result<br>(0, {0.0: [<qgis._core.QgsSnappingResult object at 0x0000000018B9C400>], 0.09699529788394015: [<qgis._core.QgsSnappingResult object at 0x0000000018B9C620>]})<br><br>I notice that the key 0.09699529788394015 is the effective distance between my start point and the segment.<br>My question is:<br>How can i modify the feature geometry to snap to the segment according to result?<br><br>Thanks<br><br>Francesco<br>