Function Syntax: 30deg Version: 1.0 Date: 26.06.2026 18:18:42 Version: 1.1 Date: 27.06.2026 07:00:22 Version: 1.2 Date: 27.06.2026 07:49:46 Version: 1.3 Date: 27.06.2026 7:48:32AM Ai+https://www.lee-mac.com/dynamicoffset.html Description This AutoLISP command creates an interactive AutoCAD tool named 30deg. The program opens a DCL dialog where the user defines angled branch geometry, offset profile size, branch behavior, Ortho mode behavior, optional picked reference angle, and target offset layer settings. The tool requires the user to pick a base point in the drawing. From that point, it dynamically previews and draws one active angled branch at a time, normally used for cable tray or similar profile routing. The branch direction can be evaluated from the default reference direction or from a user-picked reference angle. When a picked reference angle is used, the user selects two points in the drawing and the command calculates the reference angle from those points. The mouse position controls the active side and branch direction relative to the active reference angle: moving the mouse to the right or left of the base point controls the routing side, while moving the mouse above or below the base point activates the corresponding upper or lower branch. The constructed centerline is automatically placed on the layer _Hilflinie, while the offset/profile edge lines can be placed on a selected target layer from the dialog. Functionalities • Opens a custom DCL dialog for configuring the polyline generation before placement. • Allows the user to define the angled branch length in meters. • Allows the user to define the branch angle, with a default value of 30 degrees. • Provides a Reference angle section where the user can optionally calculate the active reference angle by picking two points in the drawing. • Includes a Pick angle < button that temporarily returns to the drawing and asks the user to select two points used for angle calculation. • Displays the calculated reference angle in a dedicated Calculated angle field in degrees. • Includes a Use picked reference angle checkbox. When enabled, the calculated angle becomes the active reference direction for the branch logic. • If no reference angle is picked, or if Use picked reference angle is not enabled, the command uses the old behavior with a reference angle of 0 degrees. • Provides two branch option checkboxes for enabling the upper branch and the lower branch. • Both branch options are enabled by default, but the command previews and creates only one active branch at a time, based on the mouse position relative to the picked base point and active reference angle. • Includes an optional straight end segment after the angled branch. • Allows the user to define the length of the straight end segment independently from the angled branch length, with a typical default value of 2.00 m. • The straight end segment is drawn parallel to the active reference direction, using the forward direction for the right side and the opposite direction for the left side. • Provides an Ortho ON checkbox in the dialog, checked by default, so the command can keep AutoCAD ORTHOMODE / F8 active during placement. • The command does not force Ortho mode off after placement. • Provides a profile selection list containing predefined KK cable channel profiles. • Each profile stores left and right offset distances used to generate the visible offset/profile edge lines. • Dynamically previews the centerline and offset edge lines while the mouse moves. • The dynamic length is controlled by the distance between the picked base point and the current mouse position. • Pressing ESC during placement cancels only the current placement and returns the user to the dialog without closing the command. • Pressing the left mouse button commits the preview geometry into the drawing. • Uses AutoCAD undo marks so each committed geometry action can be undone cleanly. • Provides an Undo button in the dialog to undo the last generated geometry. Reference Angle Area • Includes a dedicated Reference angle section in the DCL dialog. • The Use picked reference angle checkbox controls whether the picked and calculated angle is used by the branch creation logic. • The Pick angle < button asks the user to pick two points in the drawing. • The command calculates the angle from the first picked point to the second picked point. • The calculated value is shown in the Calculated angle field. • When the picked reference angle is active, mouse left/right and mouse up/down are evaluated relative to that calculated angle instead of world 0 degrees. • When the picked reference angle is not active, the command keeps the previous behavior and uses 0 degrees as the reference direction. Offset Layer Area • Includes a dedicated Offset layer section in the DCL dialog. • The checkbox Place offsets on layer controls whether the offset/profile edge lines are moved to a selected layer. • Includes a Filter field for filtering the available drawing layers. • Includes a Layer dropdown showing the filtered layer results. • Includes a Pick from drawing button that allows the user to select an existing object and read its layer. • Displays the currently selected offset layer name below the layer controls. • If the selected offset layer does not exist, the program creates it automatically before placing the offset lines. Layer Logic • The centerline created from the picked point is always placed on _Hilflinie. • If _Hilflinie does not exist, the program creates it automatically. • The centerline layer is set to magenta and uses the Continuous linetype. • The offset/profile edge lines are placed on the selected offset layer when the offset layer option is active. • If the offset layer option is disabled, the offset/profile edge lines remain on the current active drawing layer. • Any offset layer matching VA_KTB_KK* is set to AutoCAD color 11, not white. Profiles Used KK Gr. I i.F_220X275 with 0.1100 m left offset and 0.1100 m right offset. KK Gr. II i.F_400X275 with 0.2000 m left offset and 0.2000 m right offset. KK Gr. IIIa i.F_515X275 with 0.2575 m left offset and 0.2575 m right offset. KK Gr. IV i.F_700X285 with 0.3500 m left offset and 0.3500 m right offset. Typical Workflow • The user runs the command 30deg. • Optional: the user clicks Pick angle < and selects two points in the drawing to calculate a reference angle. • Optional: the user enables Use picked reference angle so the calculated angle controls the branch reference direction. • The user selects the branch length, branch angle, straight end option, straight end length, Ortho option, KK profile, and offset layer settings in the dialog. • The user clicks Pick Point or Apply. • The user selects a base point in the drawing. • The tool dynamically previews one active centerline branch and its profile offset edges while the mouse moves. • The user moves the mouse above or below the base point to choose the active upper or lower branch, and left or right to choose the side relative to the active reference angle. • The user clicks to create the final polylines. • The dialog returns after placement, allowing repeated use without restarting the command.