The Sample Folder or A Few LISP Files to Use

When was the last time you looked at the files in the Sample folder that gets created in the Program Files/ AutoCAD Map3D 20xx ? If you have not looked in years then let me point out a few lisp files (.lsp) that are there and may be of some use to you. Some of them are just samples and meant to be samples of what you can do with lisp programing and Map3D, however there are a few that you may want to use once in a while.

The first one I like is the makegrid.lsp.  What this does is create a grid from rectangular polylines with numbers/text inside each rectangle. It allows you to select the base point for the grid, the number of rows and columns and the size of each. With the number inside the rectangles it allows you to add a prefix and the number of digits for the number. So what do I use it for? A number of different uses but one is for creating a grid for a mapbook. Other times I may use it to create a grid if I’m creating a new line type or AutoCAD shape. Having a grid of 1×1 makes it easy to know when and where my pen up or pen down will be writing out the file.

The next one I like and use every once in a while is the copy_OD.lsp. This allows you to copy object data from one object to another. If you ever exploded a multi-segment pline to individual lines you found out the OD attached doesn’t get copied. This sample allows you to copy that OD to each line segment afterwards.

The listpt.lsp writes out the vertices of a polyline to the command line. If you use it notice it has the points inside parenthesizes  ( ), this is an “Autolisp list” but you can still it if you need to check the vertices of a polyline.

Need to see what direction an object  is going or where the start point is? Then the dirarrow.lsp is what you need to use. This sample will show a directional arrow pointing in the direction the object (Lines, Plines, Arcs) is headed. The sample uses the grdraw function which draws the directional arrow on the screen and not in the dwg file, A regen or redraw action removes the arrows from the screen.

If you are not familiar with using a lisp file with these you can drop and drag them from windows explorer into the AutoCAD editor window and the command to use them is printed to the command line. Done of them have a fancy dialog box or any help files on using them remember they are just samples but you might find some use for them. Or if you like to get into learning lisp they make  a good starting point. 

Advertisements

Archives

Readers Locations

Top Rated posts

Chat room


%d bloggers like this: