diff --git a/src/Mod/Path/PathScripts/PathSimulatorGui.py b/src/Mod/Path/PathScripts/PathSimulatorGui.py
index 24c11e5..3a23f1c 100644
--- a/src/Mod/Path/PathScripts/PathSimulatorGui.py
+++ b/src/Mod/Path/PathScripts/PathSimulatorGui.py
@@ -78,6 +78,7 @@ class PathSimulation:
         FreeCADGui.Control.showDialog(self.taskForm)
         self.disableAnim = False
         self.isVoxel = True
+        self.firstDrill = True
         self.voxSim = PathSimulator.PathSim()
         self.SimulateMill()
 
@@ -88,6 +89,7 @@ class PathSimulation:
         self.ioperation = 0
         for i in range(form.listOperations.count()):
             if form.listOperations.item(i).checkState() == QtCore.Qt.CheckState.Checked:
+                self.firstDrill = True
                 self.activeOps.append(self.operations[i])
                 self.numCommands += len(self.operations[i].Path.Commands)
         if len(self.activeOps) == 0:
@@ -180,6 +182,7 @@ class PathSimulation:
         cmd = self.operation.Path.Commands[self.icmd]
         #for cmd in job.Path.Commands:
         pathSolid = None
+        
         if cmd.Name in ['G0']:
             self.curpos = self.RapidMove(cmd, self.curpos)
         if cmd.Name in ['G1', 'G2', 'G3']:
@@ -187,6 +190,17 @@ class PathSimulation:
                 self.curpos = self.RapidMove(cmd, self.curpos)
             else:
                 (pathSolid, self.curpos) = self.GetPathSolid(self.tool, cmd, self.curpos)
+        if cmd.Name in ['G81']:
+            if self.firstDrill:
+                extendcommand = Path.Command('G1', {"X": 0.0, "Y": 0.0 , "Z": cmd.r})
+                self.curpos = self.RapidMove(extendcommand, self.curpos)
+                self.firstDrill = False
+            extendcommand = Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r})
+            self.curpos = self.RapidMove(extendcommand, self.curpos)
+            extendcommand = Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.z})
+            self.curpos = self.RapidMove(extendcommand, self.curpos)
+            extendcommand = Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r})
+            self.curpos = self.RapidMove(extendcommand, self.curpos)
         self.skipStep = False
         if pathSolid is not None:
             if self.debug:
@@ -231,6 +245,19 @@ class PathSimulation:
             if not self.disableAnim:
                 self.cutTool.Placement = self.curpos #FreeCAD.Placement(self.curpos, self.stdrot)
                 (self.cutMaterial.Mesh, self.cutMaterialIn.Mesh) = self.voxSim.GetResultMesh()
+        if cmd.Name in ['G81']:
+            extendcommands=[]
+            if self.firstDrill:
+                extendcommands.append(Path.Command('G1', {"X": 0.0, "Y": 0.0, "Z": cmd.r}))
+                self.firstDrill = False
+            extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r}))
+            extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.z}))
+            extendcommands.append(Path.Command('G1', {"X": cmd.x, "Y": cmd.y, "Z": cmd.r}))
+            for ecmd in extendcommands:
+                self.curpos = self.voxSim.ApplyCommand(self.curpos, ecmd)
+                if not self.disableAnim:
+                    self.cutTool.Placement = self.curpos #FreeCAD.Placement(self.curpos, self.stdrot)
+                    (self.cutMaterial.Mesh, self.cutMaterialIn.Mesh) = self.voxSim.GetResultMesh()
         self.icmd += 1
         self.iprogress += 1
         self.UpdateProgress()
