Lengthen

Short description

Sort / Purpose: Interactively extend lines, arcs and polylines at both start and end by user defined distances, using a dialog with separate values for each side and safe Apply or Undo control. β€’ Scope: Works on LINE, ARC, LWPOLYLINE and classic POLYLINE entities, handling straight and bulged segments at both ends. β€’ Goal: Provide a flexible Double Extend tool where you can tweak start and end extension, preview the result with Apply, step back with Undo, and only confirm when you are satisfied.
extendstartendmultiple 000

Command:

Command name: ExtendStartEndMultiple How to run: Type ExtendStartEndMultiple in the command line after loading the LISP. β€’ Selection: When prompted, select one or more LINE, ARC, LWPOLYLINE or POLYLINE entities to be extended. β€’ Dialog cycle: Use the dialog to set start and end extension values and control Apply, Undo, OK or Cancel from within the same session.

Description:

β€’ Initial globals: Stores two persistent extension values *DEX_extStart* and *DEX_extEnd* so the dialog remembers your last used distances between runs. β€’ DCL creation: Dynamically writes a temporary DCL file that defines the Double Extend dialog with two edit boxes (Extend Start and Extend End) and buttons for Apply, Undo, OK and Cancel. β€’ Dialog behavior: Each time the dialog is shown it pre fills the edit boxes from the global values and updates those globals when you press Apply or OK, converting strings to distances. β€’ Return codes: The dialog function returns a code that distinguishes between OK, Cancel, Apply and Undo so the main routine can decide what to do without re selecting geometry. β€’ Selection and group: The command first gathers a selection set of eligible entities, then starts an overall UNDO group so the entire session can be undone as one operation if desired. β€’ Apply loop: When you press Apply the routine places an UNDO mark, calls the geometry engine to extend all selected entities by the current start and end values, increments an internal apply counter and regenerates the drawing. β€’ Undo button: Pressing Undo triggers an UNDO back to the last mark, rolling back the most recent Apply, decrementing the apply counter and updating the drawing again. β€’ OK semantics: If you have never used Apply or Undo, pressing OK performs one single extension using the current values and then exits; if you have already applied or undone changes, OK simply accepts the current state without further modification. β€’ Cancel semantics: If you press Cancel or close the dialog without confirming, the routine repeats UNDO back as many times as there were Apply operations, fully restoring the pre command state and then ends the UNDO group. β€’ End of session: After leaving the dialog loop the command always closes the UNDO group, making the final chosen state a single undo step from normal AutoCAD undo.

Helper function: (if any)​

Vector and poly helpers: β€’ vxs: Multiplies a 3D vector by a scalar, used to compute extension vectors along the segment direction. β€’ LM:bulgecentre: Calculates the centre point of an arc defined by two points and a bulge value so the routine can extend bulged polyline segments accurately. β€’ LM:lwvertices: Extracts the list of lightweight polyline vertices along with width and bulge data into a structured list that can be passed to the extension processor. Extension engine: β€’ LM:dex:extendpoly: Extends the first and last segments of a polyline (lightweight or old style) by separate distances for start and end, handling both straight and bulged segments without exceeding a full circle on arcs. β€’ LM:dex:run: Core geometry driver that iterates over the selection set and applies the appropriate extension logic depending on entity type (LINE, ARC, LWPOLYLINE or POLYLINE). Dialog helpers: β€’ DEX:make-dcl: Writes the temporary DCL file describing the Double Extend dialog and returns its file name. β€’ DEX:read-values: Reads tile values extStart and extEnd from the dialog, converts them to numeric distances and updates the global extension variables. β€’ DEX:dialog: Loads the DCL, initializes tiles, assigns action tiles for Apply, Undo, OK and Cancel, runs the dialog and then returns the pressed button as a numeric result code while deleting the temporary DCL file. Error and UNDO handling: β€’ Local *error*: The command defines a local error handler that, if an error occurs while an UNDO group is active, backs out all Apply operations, closes the group and prints a message before exiting cleanly.

Functionalities:

β€’ Separate start and end control: Lets you extend the start and end of each entity by different distances so you can lengthen segments asymmetrically where needed. β€’ Multi type support: Handles plain lines, circular arcs, lightweight polylines and old style polylines, preserving bulges and widths where appropriate. β€’ Arc safety: For arcs and bulged segments the extension length is limited so that the implied arc never wraps around into a full circle, preventing invalid geometry. β€’ Iterative preview: Apply can be pressed repeatedly with different extension values in one session, allowing you to visually tune the result while Undo steps back to the previous version each time. β€’ Global persistence: The extension values are stored in global variables so the next time you run the command the dialog opens with the last used start and end distances already filled in. β€’ Undo group integration: All modifications performed while the command is active are wrapped inside a single AutoCAD UNDO group, making it easy to revert the entire operation with one undo if needed. β€’ Selection reuse: The initial selection set is kept for the whole dialog loop, so you do not need to re select objects between Apply and Undo cycles.

Result:

Result: All selected lines, arcs and polylines are extended at their start and end by the chosen distances, with the final state reflecting your last confirmed Apply or single OK execution. β€’ Precise control: You obtain fine grained control over how far each end of the geometry is extended, including curved segments, without manual stretching for each object. β€’ Safe experimentation: The Apply and Undo buttons allow you to experiment with multiple extension settings while the command is running, always able to step back to the previous state within the same session. β€’ Clean undo path: If you cancel, all extensions made during that run are reverted, leaving the drawing unchanged; if you accept, the final geometry is grouped into a single undo step for later reversal. β€’ Workflow integration: The load message reminds you that the tool is available and how to invoke it, integrating smoothly into everyday drafting for trimming and extending geometry with more flexibility than the standard extend command. Copy code: Copy ExtendStartEndMultiple LISP

Images, animations etc.

Pixel

XAML code:

ο»Ώ<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
    
    <src:RibbonToolTip x:Key="Lengthen">
        <src:RibbonToolTip.ExpandedContent>
            <StackPanel>
                <TextBlock Background="AntiqueWhite" TextAlignment="Left">
				<Bold>Function Syntax: ExtendStartEndMultiple / dex / dexdebug</Bold>
<LineBreak/>
<Bold>Version: 1.1 Date: 20.06.2026 7:35:03AM</Bold>
				<LineBreak/>
				<Hyperlink>https://www.lee-mac.com/doubleextend.html</Hyperlink>
				<LineBreak/>
<Bold>Description</Bold><LineBreak/>	
This AutoLISP program <Span Foreground="DarkRed">3CORD</Span> generates a table of coordinates for the vertices of a selected <Span Foreground="Red">3DPolyline</Span>.<LineBreak/>	
It also marks the polyline vertices in the drawing with numbers or letters corresponding to the table entries.<LineBreak/>	

<Bold>Functionalities:</Bold><LineBreak/>	
β€’ Fills the table with coordinates of <Span Foreground="Red">3DPolyline</Span> vertices.<LineBreak/>	
β€’ Marks vertices of the <Span Foreground="Red">3DPolyline</Span> according to the table data, using <Span Foreground="DarkRed">digits</Span> or <Span Foreground="DarkRed">letters</Span>.<LineBreak/>	
β€’ Prompts the user to select a <Span Foreground="Red">3DPolyline</Span>.<LineBreak/>	
β€’ Generates the coordinate table and allows inserting it into the desired location in the drawing.<LineBreak/>	
β€’ Marks each vertex after table creation with matching figures or letters.<LineBreak/>	
β€’ Provides customization options in the <Span Foreground="Red">ADJUSTMENT</Span> section for controlling display and output format.<LineBreak/>	
β€’ Works entirely within AutoCAD without requiring external files.<LineBreak/>	
β€’ Supports polyline/circle selection. Use the <Span Foreground="DarkRed">WPS</Span> command or 'WPS inside an object selection prompt.<LineBreak/>	
β€’ Program Description:<LineBreak/>	
  1. Pick polyline 1 near an end to get the end point.<LineBreak/>	
  2. Pick polyline 2.<LineBreak/>	
  3. Draw a connecting line.<LineBreak/>	
  4. Repeat steps 1–3 at the other end.<LineBreak/>	
  5. Use <Span Foreground="DarkRed">BPOLY</Span> to create a closed polyline.<LineBreak/>	
  6. Erase the temporary end lines.<LineBreak/>	
  7. Repeat steps 1–6 for as many cases as needed.<LineBreak/>	
β€’ Lets you pick both reference points on an object first, then enter the number of copies to align, unlike the standard <Span Foreground="DarkRed">ALIGN</Span> command.<LineBreak/>	
β€’ <Span Foreground="DarkRed"><Bold>Erase all objects inside a closed polyline.</Bold></Span><LineBreak/>	
β€’ This program allows the user to extend both ends of all lines, arcs, and polylines in a selection by a given amount.<LineBreak/>	
  – Command syntax: <Span Foreground="DarkRed">DEX</Span> (Double Extend).<LineBreak/>	
  – Prompts the user to specify the extension amount, offering the last entered value as a default, which is remembered between sessions.<LineBreak/>	
  – Allows selection of lines, arcs, open 2D polylines (light and heavy), or open 3D polylines in any UCS plane, including polylines with arc segments.<LineBreak/>	
  – Automatically ignores cases where extension is geometrically impossible (e.g., arc endpoints meeting or overlapping).<LineBreak/>	

<Bold>Important Commands &amp; Variables:</Bold><LineBreak/>	
β€’ <Span Foreground="DarkRed">3CORD</Span> – Main command to run the function.<LineBreak/>	
β€’ <Span Foreground="DarkRed">3DPolyline</Span> – Object type from which vertices are extracted.<LineBreak/>	
β€’ <Span Foreground="DarkRed">Table</Span> – AutoCAD table entity used to display coordinates.<LineBreak/>	
β€’ <Span Foreground="DarkRed">ADJUSTMENT</Span> – Section in the source code where display and marking options can be configured.<LineBreak/>	

</TextBlock>
            
<Grid>
<MediaElement
 Source="doubleextend1.gif"
 Stretch="Uniform"
 Visibility="Visible"/>
 </Grid>

<Grid>
<MediaElement
 Source="doubleextend2.gif"
 Stretch="Uniform"
 Visibility="Visible"/>
 </Grid>

                
 <!-- Use MediaElement for GIF (static first frame) and Image as fallback -->

</StackPanel>
    </src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>

Additional info:

Share this page:

Leave a Reply

Page Tag: 🏷️ Polyline menu

  • Lengthen

    β€”

    by

    Short description Sort / Purpose: Interactively extend lines, arcs and polylines at both start and end by user defined distances, using a dialog with separate values for each side and safe Apply or Undo control. β€’ Scope: Works on LINE, ARC, LWPOLYLINE and classic POLYLINE entities, handling straight and bulged segments at both ends. β€’…

  • InteriorPolylinesArea

    β€”

    by

    Short description Purpose: Provide a unified dialog interface for running multiple area-processing operations inside closed polylines Use cases: Creating inside boundaries, breaking curves, converting regions to polylines, filtering out open polylines, or joining areas Memory: Stores last chosen option in *BR2P-last-option* and auto-selects it next run Command: Command name: BR2P Dialog: Seven radio options select…

  • DoubleOffset

    β€”

    by

    Short description Comming soon … Command: Comming soon … Description: Comming soon … Helper function: (if any)​ Comming soon … Functionalities: Comming soon … Result: Comming soon … Images, animations etc. Lisp code: Expand Code ⬇ Select Code Copy Code Comming soon … Share this page:

  • CopySelection

    β€”

    by

    Short description Purpose: Duplicate only a chosen segment of a LWPolyline between two picked points and generate it on a selected layer Supported objects: Single LWPOLYLINE only Usage style: Extract partial polyline segments and place them on a different layer using a filterable layer picker dialog Command: Command name: CopySelection How to run: Type COPYSELECTION…

  • CloseParalelPolylines

    β€”

    by

    Short description Purpose: Automatically connect two open or parallel-like entities and merge them into one continuous polyline Supported objects: LWPOLYLINE, LINE, ARC, SPLINE Usage style: Cleanup or closing gaps between two aligned open objects Command: Command name: CloseParallelPolylines How to run: Type CLOSEPARALLELPOLYLINES and press Enter User prompt: Select two open polylines, arcs, splines, or…

  • PLLengthByLayer

    β€”

    by

    Short description Command: Description: Helper function: (if any)​ Functionalities: Result: Images, animations etc. XAML code: Expand Code ↓ Select Code Copy Code ο»Ώ<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="PLLengthByLayer"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: PLLengthByLayer</Bold> <LineBreak/> <Bold>Version: 1.0 Date: 20.06.2026 6:38:49PM</Bold> <LineBreak/> <Hyperlink>N/A</Hyperlink> <LineBreak/> <Bold><Run Foreground="DodgerBlue">πŸ“ Function Syntax: PLLengthByLayer</Run></Bold><LineBreak/> <Bold><Run Foreground="LimeGreen">Version: 1.0</Run></Bold><LineBreak/> <Bold><Run Foreground="Orange">πŸš€…

  • Slope

    β€”

    by

    XAML code: Expand Code ↓ Select Code Copy Code <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows"> <src:RibbonToolTip x:Key="Test"> <src:RibbonToolTip.ExpandedContent> <StackPanel> <TextBlock Background="AntiqueWhite" TextAlignment="Left"> <Bold>Function Syntax: Command</Bold> <LineBreak/> <Bold>Version: 1 Date: 09.12.2025</Bold> <LineBreak/> <LineBreak/> <Hyperlink>AI+Hyperlinkhttpsforums.augi.comshowthread.php107096-Slopes-and-angles-of-a-polyline-in-2d-autocadHyperlink</Hyperlink> <LineBreak/> <Bold>Description</Bold><LineBreak/> This LISP implements a β€œslope label placer” with a DCL dialog. After the dialog, it runs in one of two input modes:<LineBreak/>…

  • MultiOffsetBothSidesWithLayer

    β€”

    by

    Short description This AutoLISP routine automates the process of offsetting multiple lines on both sides with customizable distances, profiles, and layer management. It is designed to simplify symmetrical drafting operations by providing an interactive dialog for user control and configuration. Command: Command: c:MultiOffsetBothSidesWithLayer This command allows the user to select multiple line objects, define offset…

  • Polyline menu

    Lisp code: Expand Code ↓ Select Code Copy Code ; — auto-generated by LispLoader — ; Menu: Polyline_menu ; Generated: 2026-06-09 07:39:13 (setq base "C:\\Users\\mateid\\OneDrive – DB E.C.O. Group\\@C3D\\@Dan_Templates\\Acad\\Support_files\\Lisps\\Help_File\\") (load (strcat base "Polyline_menu\\2DPL_LW\\2DTOLW.lsp")) (load (strcat base "Polyline_menu\\2DPolyVertexExport\\2DPolyVertexExport.LSP")) (load (strcat base "Polyline_menu\\3DPolyVertex2Table\\3DPolyVertex2Table.lsp")) (load (strcat base "Polyline_menu\\AdvancedPolylineOutline\\AdvancedPolylineOutline.lsp")) (load (strcat base "Polyline_menu\\All_inside\\All_inside.lsp")) (load (strcat base "Polyline_menu\\BreakObjects\\BreakObjects.lsp")) (load (strcat…