From 673beb7d3a43044c8a8d01623eca1dd0b8ab9e15 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 21 Mar 2024 10:38:19 +0100 Subject: [PATCH] Arch: Register interactive arch tools to draft --- src/Mod/Arch/ArchStructure.py | 5 +++++ src/Mod/Arch/ArchWall.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index a1da58dde3..46616b0443 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -325,6 +325,7 @@ class _CommandStructure: title=translate("Arch","First point of the beam")+":" else: title=translate("Arch","Base point of column")+":" + FreeCAD.activeDraftCommand = self # register as a Draft command for auto grid on/off FreeCADGui.Snapper.getPoint(callback=self.getPoint,movecallback=self.update,extradlg=[self.taskbox(),self.precast.form,self.dents.form],title=title) def getPoint(self,point=None,obj=None): @@ -334,12 +335,16 @@ class _CommandStructure: self.bmode = self.modeb.isChecked() if point is None: self.tracker.finalize() + FreeCAD.activeDraftCommand = None + FreeCADGui.Snapper.off() return if self.bmode and (self.bpoint is None): self.bpoint = point FreeCADGui.Snapper.getPoint(last=point,callback=self.getPoint,movecallback=self.update,extradlg=[self.taskbox(),self.precast.form,self.dents.form],title=translate("Arch","Next point")+":",mode="line") return self.tracker.finalize() + FreeCAD.activeDraftCommand = None + FreeCADGui.Snapper.off() horiz = True # determines the type of rotation to apply to the final object FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Structure")) FreeCADGui.addModule("Arch") diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 89d8e953c6..f7176d42ad 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -349,6 +349,7 @@ class _CommandWall: import WorkingPlane self.wp = WorkingPlane.get_working_plane() self.tracker = DraftTrackers.boxTracker() + FreeCAD.activeDraftCommand = self # register as a Draft command for auto grid on/off FreeCADGui.Snapper.getPoint(callback=self.getPoint, extradlg=self.taskbox(), title=translate("Arch","First point of wall")+":") @@ -373,6 +374,8 @@ class _CommandWall: self.existing.append(obj) if point is None: self.tracker.finalize() + FreeCAD.activeDraftCommand = None + FreeCADGui.Snapper.off() return self.points.append(point) if len(self.points) == 1: @@ -390,6 +393,8 @@ class _CommandWall: l = Part.LineSegment(self.wp.get_local_coords(self.points[0]), self.wp.get_local_coords(self.points[1])) self.tracker.finalize() + FreeCAD.activeDraftCommand = None + FreeCADGui.Snapper.off() FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Wall")) FreeCADGui.addModule("Arch") FreeCADGui.doCommand('import Part')