How is it possible to change the "Avoid Intersections" parameter with PyQGIS in QGIS 3.10?
I want to enable "avoid interceptions", so that in edit mode, when the new polygon overlaps the polygons of the active layer, the part where there is an overlap is automatically deleted (auto-complete editing of the polygon).
In QGIS 2.X the QgsProject().setSnapSettingsForLayer() function included the "Avoid Intersections" parameter but this is not included in the QgsSnappingConfig().IndividualLayerSettings() function in QGIS 3.10.
layer = qgis.utils.iface.activeLayer()
snap_config = QgsSnappingConfig()
snap_config.setEnabled(True)
snap_config.setType(QgsSnappingConfig.VertexAndSegment)
snap_config.setUnits(QgsTolerance.Pixels)
snap_config.setTolerance(10)
snap_config.setIntersectionSnapping(True)
snap_config.setMode(QgsSnappingConfig.SnappingMode.AdvancedConfiguration)
lyr_settings = QgsSnappingConfig.IndividualLayerSettings(
True, QgsSnappingConfig.SnappingType.VertexAndSegment,
10, QgsTolerance.Pixels)
snap_config.setIndividualLayerSettings(layer, lyr_settings)
QgsProject.instance().setSnappingConfig(snap_config)