autolisper's Home Page

Chinese  English


I wish to share the happy of Lisp with all of you~

I will record some of my recently Lisp. You can contact me with


About me.
Name          :  CHEN QING JUN

Work           :  South China University of Technology,   Civil Engineering Department.

Title             :  National registered Grade A structural engineer,
                        :   National registered geotechnical engineer

Speciality    : Structure analysis [ be familiar with Etabs, Midas, Staad
                                 PKPM(chinese) Gscad(chinese) ]
                            : Finite element analysis [ be familiar with Algor,  Ansys
                                 Sap2000, Safe, DianaAbaqus]
                                 be able to use Truegrid,Hypermesh]
                            : Cad or Cam Model  [be familiar with Autocad, Catia, Inventor,
                                 be able to use Rhino, 3dsmax]
                            : Programming [be familiar with Autolisp, can use python,
                                 Fortran, Basic, pascal to program]

Hobby          : Tabble tennis and rubik cube



Here is some of my post Lisp
1)dynamic polyline offset

2) my comprehension about the variable, function, local and total variable

3) A introduction of new Lisp develop tool-Lsharp(in Chinese)

4) my comprehension about SECONDDERIV, a vla-function (most in Chinese)
this function is a very strange function, for line polyline, circle, spline, it has different meaning, especially in Ellipse, I find Kepler Law hide in it, funny.

5) How to make the Lisp file can be also print as colorful (not my original code)

6) Calculate the moment of inertia

7) My dynamic change Excel continous beam calculation.

8) My recollection of Cadalyst's sort explanation, so you can find your tips more quickly
Note: has thousands of code to download, but you will find it is hard to find what your want, but if you get this xls file, you can search in it, justlike, you can search "scale" to find the function, and find such as "scale circle" "scale donut", etc.

9) My translation the function of stdlib to Chinese.

10) My early code: Join line (note, I hide the code not because it is secrete, but because it is too tedious:(, the follow 2 is also the reason, the command is x)

11) My early code: Region trim (note, trim the line inside a circle, rectangle, some polyline, Platform: after R14, command is dr)

12) My early code : batch 4 line trim (note, need regular line, very regular, it is use for our structural drawing, while clean the beam line, Platform: after R14, command is te)

13) My early code: layer operation, it like most people start the Lisp from the Layer control.

Some of my favoriate function(others)
1) the clean of the intersection region between 4 lines


Recently, I post at theswamp about Fractal tree. 

A funny draw fractal tree code, there are 6 pattern already defined inside, you
can change as you like:)



My lisp

1. Match text-- my early Lisp, select the first text, then select the other

text to match the text content.

2. Equal distance place object --- select some object, then it will align

them in a line according to the first and last object and place them in

equal distance, use the getboundingbox to define the object center

3. Combine trim and extend-- select a curve, then select some line, they

will be trim or extend to the line

4. Draw a line through to divide the region to equal area --- In one

closed region, select one point, then it will draw a line to divide the

region to equal area.

5. Draw parabolic curve by cut a cone by a plane --- It is my first study

of the Vla activex function

6. Convert table (not 2006 table object) to Excel --- Select the N*M

table draw by line or pline and text, then it will write the text to the

Excel file.

This rountine got The TOP TIP HARRY APRIL winner


7. Clock in ACAD-- use grdraw to draw a clock in ACAD.

8. Draw a minimum circle that contain select points---- My first time of

touching  Computational Geometry, and use Menzi's code about

convex hull.

9. Convert acad line and surface model to ANSYS model --- just for

personal use.

10. Current Style ---- Select text or dim object to set the textstyle or

dimstyle of the current style

11. Width change double pline --- draw different segment width double-line


12. Matrix application: solve equation





 Today I post a Lisp in to find each closed boundary of selected object

The code locate here 

GBPOLY at geometricad and gbound at
are all excellent program to find the boundary, but they are all arx and time limitation,
so I want to find each boundary by lisp
I use the method:scan line

like the graph 1, the green line from bottom to top to scan the object
then find the intersections between the green line and the object selected  fence by it.
inter1=[I1, I2, I3, I4, I5, I6]
then get the midpoint of each [I1 I2], [I2,I3] **** and get inter1mid

in each inter1mid, found the boundary by std-poly, at the same time find the intersections between the scan line and the boundary object in layer "bound" (I assume no other object in this layer that need to find boundary], so get the new list
inter2=[I1' I2'] ,
inter2 will update at each production of the new boundary.
then find the midpoint of [I1' I2'], [I3' I4']   (it is different from the inter1mid)
then if the midpoint of inter1mid is the member of the inter2mid, it means that the boundary have made, and needn't to make again, the progress skip to next point.
In many cases it is OK, but it sometimes make some duplicate boundary, I should continue to improve it.

The efficiency is low, I hope you can give me some advise, thank you
very much.







Recently  I post a  Lisp in,  thanks great to CAB.

Function:Routine to break entities at ALL intersections

by learning the code of CAB, I write down the following code.
Thanks to CAB and the Korea friend from
note:the color in the picture is not produced by program.



 recently someone ask for a program to Change the color of the circle gradiently according to their radius

Then the code is  as  here 

You can first create some circles as

 (defun c:test () (setq i 1) (repeat 250 (entmake (list (cons 0 "CIRCLE") (cons 62 i) (cons 10 (list 0.0 0.0 0.0)) 		 (cons 40 i) 	 ) ) (setq i (1+ i)) ) (command "zoom" "e" " ") )

Then use the code to change the color, the effect maybe as





by qjchen