MSL LISP: Scale Lines About Their Own Midpoint (Free AutoLISP Download)
Scaling a line from its midpoint (rather than from an endpoint or a separately-picked base point) is an uncommon requirement, but when needed, such as adjusting the length of multiple cross-section lines along a road/pipeline alignment, doing it manually for each line individually is slow. MSL scales all selected lines from each line's own midpoint, in a single command, given one scale factor.
MIDSCL-bgol (Scale Lines About Their Own Midpoint)
Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in
Inspired by the general concept of midpoint-based batch line scaling utilities used in CAD drafting. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.
Overview
Scaling a line from its midpoint (rather than from an endpoint or a separately-picked base point) is an uncommon requirement, but when needed, such as adjusting the length of multiple cross-section lines along a road/pipeline alignment, doing it manually for each line individually is slow. MSL scales all selected lines from each line's own midpoint, in a single command, given one scale factor.
How to Use
- Load
MIDSCL-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
MSLat the command line and press Enter. - Select the line(s) you want to scale, then press Enter to confirm the selection (only
LINEentities are picked up by the selection filter). - At the
Scale factor (about each line's midpoint):prompt, enter a value greater than 1 to lengthen, or less than 1 to shorten. - Each selected line is scaled about its own midpoint, the midpoint stays fixed while both endpoints move symmetrically inward or outward.
Why Use It
- Batch Operation, scales multiple lines in a single command instead of using the native
SCALEcommand (with base point selection) repeatedly for each line. - Midpoint-Centered, scaling about each line's own midpoint (rather than a single shared base point or an endpoint) keeps each line symmetric and centered at its original position, the natural behavior wanted for things like cross-section lines.
- Time Savings, particularly useful for adjusting many cross- section lines along an alignment uniformly in one operation.
Where to Use It
- Uniformly lengthening or shortening a batch of cross-section lines along a road, pipeline, or channel alignment.
- Any scenario requiring multiple lines resized symmetrically about their own centers, rather than from a single external base point.
Notes
- The selection prompt filters for
LINEentities only; polylines, arcs, and other entity types are not affected even if included in a broader pick. - A scale factor of exactly
1leaves lines unchanged; the routine requires a positive factor (zero or negative values are rejected). - Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.
Credits
Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.
Frequently Asked Questions
MSL is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
The selection prompt filters for LINE entities only; polylines, arcs, and other entity types are not affected even if included in a broader pick.
Batch Operation, scales multiple lines in a single command instead of using the native SCALE command (with base point selection) repeatedly for each line.
Yes. MSL is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop MIDSCL-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type MSL at the command line to run it.
๐ค About BGol Community
BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.
๐ Made with โค๏ธ by BGol Community of Advanced Surveying
Free, open-source, and built for the CAD community, for personal or commercial use, always.