Repository: FreeCAD/FreeCAD
File: src/Mod/BIM/ArchWindowPresets.py (Python)

Code before:
                ["RightMostGlass", "Glass panel", "Wire9", str(w2 / gla), str(o2 + w2 / 2) + "+V"]
            )

        elif windowtype == "Awning":

            wp = outerFrame(s, width, height, h1, w1, o1)
            simpleFrame(s, width, height, h1, h2, tol)
            fw = str(w2)
            if w2 == w1:
                fw = "0.00+V"
            wp.extend(["InnerFrame", "Frame", "Wire2,Wire3,Edge7,Mode1", fw, str(o2) + "+V"])
            wp.extend(
                ["InnerGlass", "Glass panel", "Wire3", str(w2 / gla), str(o2 + w2 / 2) + "+V"]
            )

        elif windowtype == "Simple door":

            wp = doorFrame(s, width, height, h1, w1, o1)
            wp.extend(["Door", "Solid panel", "Wire1,Edge8,Mode1", str(w2), str(o2) + "+V"])

        elif windowtype == "Sliding door":
            wp = doorFrame(s, width, height, h1, w1, o1)
            # Use Wire1 as the inner opening
            # Use Edge 1 (the bottom edge of the frame) as the track
            # Use Mode 9 (sliding)
            wp.extend(["Door", "Solid panel", "Wire1,Edge1,Mode9", str(w2), str(o2) + "+V"])

        elif windowtype == "Glass door":

            wp = doorFrame(s, width, height, h1, w1, o1)
            p1 = Vector(h1 + tol, h1 + tol, 0)
            p2 = Vector(width - (h1 + tol), h1 + tol, 0)
            p3 = Vector(width - (h1 + tol), height - (h1 + tol), 0)
            p4 = Vector(h1 + tol, height - (h1 + tol), 0)
            p5 = Vector(h1 + h2, h1 + h3, 0)
            p6 = Vector(width - (h1 + h2), h1 + h3, 0)
            p7 = Vector(width - (h1 + h2), height - (h1 + h2), 0)
            p8 = Vector(h1 + h2, height - (h1 + h2), 0)
            addFrame(s, p1, p2, p3, p4, p5, p6, p7, p8)
            s.addConstraint(Sketcher.Constraint("DistanceX", 8, 1, 12, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceY", 8, 1, 12, 1, h3))
            s.addConstraint(Sketcher.Constraint("DistanceX", 14, 1, 10, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceY", 14, 1, 10, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceX", 4, 1, 8, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceY", 4, 1, 8, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceX", 10, 1, 6, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceY", 10, 1, 6, 1, tol))
            if h2 == h1:
                s.renameConstraint(39, "Frame5")
                s.renameConstraint(40, "Frame6")
                s.renameConstraint(42, "Frame7")

Review comment (suggestion):
Use Edge7 for the track. It matched the width of the door. The 70% solution can then perhaps be improved.

EDIT: alternatively it may be worth considering adding an extra line to the sketch for the track. Its length can then be controlled with constraints and the travel can be kept at 100%.

Code after:
                ["RightMostGlass", "Glass panel", "Wire9", str(w2 / gla), str(o2 + w2 / 2) + "+V"]
            )

        elif windowtype == "Awning":

            wp = outerFrame(s, width, height, h1, w1, o1)
            simpleFrame(s, width, height, h1, h2, tol)
            fw = str(w2)
            if w2 == w1:
                fw = "0.00+V"
            wp.extend(["InnerFrame", "Frame", "Wire2,Wire3,Edge7,Mode1", fw, str(o2) + "+V"])
            wp.extend(
                ["InnerGlass", "Glass panel", "Wire3", str(w2 / gla), str(o2 + w2 / 2) + "+V"]
            )

        elif windowtype == "Simple door":

            wp = doorFrame(s, width, height, h1, w1, o1)
            wp.extend(["Door", "Solid panel", "Wire1,Edge8,Mode1", str(w2), str(o2) + "+V"])

        elif windowtype == "Sliding door":
            wp = doorFrame(s, width, height, h1, w1, o1)
            # Use Wire1 (inner frame boundary) as the door leaf profile to be extruded
            # Use Edge 7 (the top edge of the inner frame) as the track. Edge5 (bottom edge) could
            # be an alternative, but it's difficult to select in the window editor, as the outer
            # frame's bottom edge is drawn on top.
            # Use Mode 9 (Sliding) to open from left to right.
            wp.extend(["Door", "Solid panel", "Wire1,Edge7,Mode9", str(w2), str(o2) + "+V"])

        elif windowtype == "Glass door":

            wp = doorFrame(s, width, height, h1, w1, o1)
            p1 = Vector(h1 + tol, h1 + tol, 0)
            p2 = Vector(width - (h1 + tol), h1 + tol, 0)
            p3 = Vector(width - (h1 + tol), height - (h1 + tol), 0)
            p4 = Vector(h1 + tol, height - (h1 + tol), 0)
            p5 = Vector(h1 + h2, h1 + h3, 0)
            p6 = Vector(width - (h1 + h2), h1 + h3, 0)
            p7 = Vector(width - (h1 + h2), height - (h1 + h2), 0)
            p8 = Vector(h1 + h2, height - (h1 + h2), 0)
            addFrame(s, p1, p2, p3, p4, p5, p6, p7, p8)
            s.addConstraint(Sketcher.Constraint("DistanceX", 8, 1, 12, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceY", 8, 1, 12, 1, h3))
            s.addConstraint(Sketcher.Constraint("DistanceX", 14, 1, 10, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceY", 14, 1, 10, 1, h2))
            s.addConstraint(Sketcher.Constraint("DistanceX", 4, 1, 8, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceY", 4, 1, 8, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceX", 10, 1, 6, 1, tol))
            s.addConstraint(Sketcher.Constraint("DistanceY", 10, 1, 6, 1, tol))
            if h2 == h1:
                s.renameConstraint(39, "Frame5")