Function Syntax: OFFSET3D https://www.cadtutor.net/forum/topic/221-how-do-i-offset-3d-polyline/page/2/ http://www.black-cad.de/starten.htm https://www.ant-ares.de/ Description: This function will ask the user to select a 3d-polyline. This 3d-polyline will be projected on the plane z=0. There will be done the offset- command in 2d and then the offsetted 3d-polyline will be constructed from the 2d- and 3d coordinates. Description This AutoLISP program performs a 3D Offset operation on an existing 3D Polyline. It temporarily projects the 3D Polyline into a 2D plane, applies an offset distance entered by the user, and then rebuilds a new offset 3D Polyline that follows the original’s elevation pattern. Main command OFFSET3D — creates a 3D offset of a selected 3D Polyline. Sub-function polypt — extracts the list of vertex points (XYZ coordinates) from a Polyline entity. What the user does • Run OFFSET3D. • Select a 3D Polyline when prompted. • Enter the desired offset distance using the keyboard. • Wait while the program creates a new 3D offset version of the polyline. Main steps performed • Saves current AutoCAD system variables: OSMODE, PLINETYPE, and VIEWDIR. • Disables object snaps and sets PLINETYPE to 0 to work in classic polyline mode. • Sets the UCS to the World Coordinate System and switches the view to a top (plan) view for accurate projection. • Uses the helper function (polypt) to extract all vertex coordinates from the selected polyline. • Creates a temporary 2D polyline using the (x, y) coordinates from the original 3D polyline. • Prompts the user for the offset distance: (getreal "\ndistance by keyboard: "). • Executes the standard AutoCAD OFFSET command to offset the temporary 2D polyline. • Extracts vertex points from the new offset 2D polyline using (polypt) again. • Builds a new 3D Polyline by combining the original Z-values with the offset XY-coordinates. • Erases temporary 2D geometry used during the process. • Restores previous AutoCAD settings for OSMODE, PLINETYPE, and view direction. Result A new 3D Polyline is created, offset from the original by the specified distance, while retaining the vertical (Z) profile of the source polyline. Key functionalities • Generates a 3D offset copy of an existing 3D Polyline. • Maintains elevation values of the original geometry. • Automatically handles conversion between 3D and 2D projections. • Uses the polypt function to extract and rebuild vertex lists. • Restores system settings to ensure safe and reversible execution. • Accepts custom offset distances entered manually. • Removes intermediate temporary polylines automatically. Helper function details polypt(ss) — Checks if the selected entity is a POLYLINE and builds a list of all its vertex coordinates. If the selected object is not a polyline, it displays: "this is not a POLYLINE !" and exits the routine. Important implementation notes • The routine works only with 3D Polylines (POLYLINE entities of 3D type). • The offset distance must be input manually; no dynamic preview is provided. • The elevation data for the new polyline is inherited from the original 3D geometry. • The function temporarily redefines the view to ensure correct offset direction. • All temporary objects created during the operation are automatically erased at the end. • Recommended to save your drawing before running, as complex 3D offsets can create geometry variations.