I have this method that triggers the tools mentioned in the subject, but only 
sometimes it triggers Digitize with Segment.  Other times it seems to revert to 
Digitize with Shape.  IDK if something after the fact is resetting it.

@classmethod
    def trigger_line_feature_digitize_with_segment(cls) -> None:
        """Triggers the Polygon Tool of the Digitizing Toolbar and Digitize 
with Segment.
        One current use is when user draws an AOI or LUC polygon.
        """
        for action in iface.digitizeToolBar().actions():
            if action.text() == "Add Line Feature":
                action.trigger()
                cls._log_qgis_settings_msg("Add Line Feature Triggered")
                break

        for qtoolbutton in iface.digitizeToolBar().findChildren(QToolButton):
            if qtoolbutton.menu():
                for action in qtoolbutton.menu().actions():
                    if action.text() == "Digitize with Segment":
                        action.trigger()
                        cls._log_qgis_settings_msg("Digitize with Segment 
Triggered")
                        break


Luke Catania
US Army ERDC-GRL
JCMS Site Planning Developer

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to