Home > other >  A plug-in, cad LISP, small problems to solve
A plug-in, cad LISP, small problems to solve

Time:09-19

This is an automatically get more inline graphics plug-in, can choose success, but after just choose good graphics will disappear, do anything is the same as a result, the following is the code:
; Polyline/circle the select - www.xanadu.cz - www.cadforum.cz
; (use the WPS command or 'WPS inside an object selection prompt)

C: (defun WPS (/I elist at cmde cen rad (p1)
(setq cmde getvar (" cmdecho "))
(setvar "cmdecho" 0)
(setq I 0 elist (entget (car (entsel "\ nPick a circle or polyline:"))))
7 (getvar (setvar "OSMODE" (boole "OSMODE") 16384))
(if (zerop (getvar "CMDACTIVE")) (the command "_select"))
(the command "_wp"); The or _CP
(if (=(CDR (assoc 0 elist)) "CIRCLE")
(progn
(setq cen (CDR (assoc elist) 10)
Rad (CDR (assoc 40 elist))
)
(repeat 90; 360/4 0.06981317=4 * PI/180
(setq p1 (polar cen (* I 0.06981317 rad) I (1 + I))
; (the command "_POINT" 0 1) p1 (trans)
0 1) p1 (command (trans)
)); The else
(repeat (length elist)
(setq ats (NTH I elist) I (1 + I))
; (if (=(car at) 10) (command (CDR at)))
(if (=(car at) 10) (command (trans (CDR) at 0, 1)))
)
); If CIRCLE
(the command "")
(setvar "OSMODE" (boole 2 (getvar "OSMODE") 16384))
(setvar "cmdecho" cmde)
(princ)
)
  • Related