LISP Routines

Some people do crosswords....the following are a number of LISP routines in various stages of completion, offering various degrees of utility. Many are very protocol-specific, but feel free to adapt any code for your own ends. You needn't credit me as I myself steal ideas all the time. Constructive comments are treasured, so don't be shy. (Especially if you can make them work better.) Of course, you assume all risks if you use them.

LISP Routine Description Command Line Interface / Associated DCL Command Status Functionality Rating

=.lsp

Allows tranparent keyboard entry of Imperial units in a Metric drawing file. Passes converted metric dimensions to all commands.

Command Line

=

Functional

Won't accept fractional inches (yet).

3D-Projector.lsp

Prompts you for 3 points to define a plane, and then a point, and yields the .XY of the last point with the Z adjusted to "project" the point onto the plane. Once set, the plane can be reused all session or until reset. Can be used transparently at all "From Point:" and "To Point:" prompts, and for grip editing. (A 3D modelling tool.)

Command Line

]

Good

Can only maintain osnap settings while in continuous use. Type "restore" after using it to restore them.

3dtools.lsp A three-in-one lisp.
'Elv' sets the elevation variable to match a picked point,
'th' sets the thickness variable to the z-difference between two picked points (positive or negative),
and 'xy' filters for .XY and returns a point at the current elevation (Z).
Command Line elv

th

xy
Finished Handy for drawing 3D models
10.lsp Changes either the color of selected entities or the current color to color 10 (my default hatch color). Command Line 10 Finished Perfect
attcopy.lsp Copies attribute values from a selected block to any number of other selected block as long as the attribute tags are identical. The blocks do not have to be the same, and any tags that don't match are ignored Command Line attcopy Finished for now Works
attfix.lsp Adds prefixes and/or suffixes to a selection set of blocks with a single attribute. Allows user to specify spaces between prefixes and/or suffixes and the original attribute value. Command Line attfix Finished for now Works
balign.lsp Aligns block or text insertions along a line you draw in the lisp, but which doesn't survive the function. Command Line balign Finished for now. Works best in WCS
bscale.lsp Scales any number of blocks or text entities about their individual insertions by a common scaling factor so they don't move relative to each other. Command Line bscale Finished Perfect
Bseq.lsp Does a multiple insert of any block with only one attribute, supplying each a numerical attribute, with each value greater than the last by your specified increment. Also accepts alpha-numeric prefixes to the sequential number portion Command Line bseq Finished Good, but exits with a bump.
bsubst.LSP Substitutes a selection of blocks with another, while keeping the insertion, scale and rotation, etc. of the originals. Command Line bsubst Finished Good.
Byl.lsp Takes a selection set and changes all the items to Bylayer color and linetype, or if nothing is selected, changes the current layer and linetype settings to Bylayer. Command Line byl Finished Perfect
check4square.lsp Checks a selection set and finds all the lines that are not square to the current UCS. Then gives you the options of highlighting, erasing, or changing them. Command Line check4square Finished. Perfect, now that fuzz factor has been added.
converter.lsp Makes a copy of a selected text entity containing a real number and converts the original value to Metric or Imperial units in the copy. Conceived for labels or tables. Must have sqm and sqft defined as units in the acad.unt file in order to work. Command Line converter Finished Good
Deldbl.lsp Scans a selection or the entire database for exactly duplicate entities. Reports the number of duplicates and prompts the user to view, erase, or change them. Command Line deldbl Finished Perfect, now that fuzz factor has been added.
Demo.lsp Changes selected entities layers to layers who's name have the same first two characters followed by "demo". Command Line demo Finished for now Won't create the demo layers.
Dimset.lsp Sets the current dimstyle by picking a dimension entity on screen. Command Line dimset Finished for now Haven't discovered why it occassionally refuse to work on a leader. Usually works....
Doorplan.lsp Inserts predefined door plan blocks onto the appropriate layer in my protocol after trimming the walls. (A2K) You will need the blocks and the layers, but it can be modified to suit other protocols. dr.dcl dr Finished for now Good
Doorplan-R14.lsp Same as above but for R14. dr.dcl dr Finished for now Good
Dvdr.lsp Distributes points along a distance spaced in a pattern of A-b-A-b-...-A where A and b are different distances. You specify one of them and the number of A's required. (A Proportional Divider) Command Line dvdr Finished Flawless
HowHi.lsp Uses leaders to label the elevation of points relative to the Y-axis of the current UCS. Has variable accuracy, and some unit conversion capability. Command Line howhi Finished for now Good
Length.lsp Draws a polyline up to a specified length limit. When the next point would make the polyline longer than the maximum length specified, it draws a circle with a radius of the remaining length centered on the last valid point specified. Command Line length "First Draft" Works
LtsMatch.lsp Changes the individual LTSCALE of a selection of items. It gives the option of applying the individual LTSCALE of a selected item to a selection set, or applying a specified individual LTSCALE to a selection set. . Command Line ltsmatch Finished Works
MBA-layers.LSP Changes the current layer to another with the same name prefix and with a name suffix through a keyword function. Cuts keystrokes when changing layers in my protocol. Command Line - Finished Flawless
mmirr.lsp Saves a mirror axis for subsequent reuse in multiple mirroring functions. Command Line mmirr Finished Perfect
mBRK.lsp Breaks a series of lines where they intersect with a selected line, much like trim but without the deletions. Command Line mbrk Needs some work Only works on lines, locked objects will abort it.
Mylexplode.lsp Does a WYSIWYG explode of blocks containing entities with ByLayer and ByBlock properties when the block has had a color and linetype assigned to it. Command Line myexplode Finished Perfect
Next.lsp Steps through the layer table, one layer at a time, isolating each individual layer for viewing. Use it when trying to understand someone else's drawings or cleaning up your own. Command Line next Finished Good
PlWid.lsp Changes the thickness of multiple polylines to a specified thickness. Reports if ordinary lines are selected and prompts for permission to change them into polylines with the desired thickness. Command Line plwid Finished Works
see.lsp Thaws and turns on layer(s) specified so you can "see" them. Command Line see Finished Perfect
SiteStats.lsp Performs a bunch of functions related to the preparation of site statitistics, but is also a design aid where lots of area polygons need to be constantly tabulated. Performs arithmetic functions using text entities containing numbers as entries, and as a delivery target for the answers like an 'on screen' calculator. Other functions include labelling the areas of closed polylines with text, adding prefixes and/or suffixes to selections of text, and a version of my "converter" lisp that will translate metric areas to imperial and vice versa. Command Line cvrt, are, fix, +, -, *, / Finished for now. Works
splice.lsp "Joins" two colinear lines into one line having the properties of the first one picked. 2D only. Command Line splice Finished Perfect. New fuzz factor added.
strip.lsp Strips off any leading spaces in any number of text entities. Command Line strip Finished Perfect
sysvarreport.LSP Reports on the status of a set of system variables if they deviate from preferred values. The list should be customized by each individual user. Command Line sysvarreport Finished Works
to.lsp A TILEMODE toggle. Command Line to Finished Perfect
topo.lsp A site grading utility that performs three functions. It indicates gradients with a leader and some text, it assigns a grade to a point given a reference grade and a slope percentage, and it interpolates between grades on the plan annotating with either a point and some text or a block with one attribute. It also has the ability to reconcile metric grading (say) scaled into a feet-and-inches drawing, or to calculate grades in decimal-feet. The change in units is factored in and the slope is correct despite the different units. It uses the current layer,textstyle, dimstyle, USC, etc., and can recognize grades from attributes, blocks, text, or XREFs. It can now ignore non-numeric prefixes or suffixes in existing grades, and add such to new grade points.
Fixed-height textstyle bug fix, June 2004. Added block-scaling feature, October 2006
Command Line topo A powerful tool! Works
vpfrz.lsp Freezes a layer in the current floating viewport by picking an object in the port on that layer. Has options to select the layer of nested enities or that of container blocks or XREFs. Command Line vpfrz Finished Perfect
ucsID.lsp Reports the coordinates of a chosen point in reference to a specified UCS, regardless of the current UCS. Command Line ucsid Finished Works
win.lsp Draws Windows in elevation using my layer protocol. You specify certain dimension, window type, and just pick two points. win.dcl win Unfinished Don't try this at home.
win2.lsp Draws Windows in elevation using my layer protocol. You specify certain dimension, window type, and just pick two points. Command Line win Finished Works
y.lsp Filters for the X value of a selected point, but prompts for a desired Y value and returns a point combining them at Z=0. Command Line y Finished Allows metric or imperial input, and inches or decimal feet, but not feet and inches.