Guys,
Can someone please assist me.
I want to use lisp to draw multiple polylines on a set layer and colour and line width ect.
I can make it do it for a polyline though how do I make it repeat without giving it a set number ?
below is the routine at present:
Code:
(defun c:APL (/ oldexpert oldfiledia oldclayer pln SJC)
(setvar "cmdecho" 0)
(setvar "orthomode" 1)
(setq oldexpert (getvar "expert")
oldfiledia (getvar "filedia")
oldclayer (getvar "clayer")
)
;;loop to draw pline
(defun pln ()
(command "plinewid" 100) ;sets polyline width to 100
(command "_pline")
(while (= (getvar "cmdactive") 1 ) (command pause) )
(command "plinewid" 0) ;sets polyline width back to 0
) ;end defun
;;looks for SJC.lin linetype file and loads DASHED2 linetype file if found
(setq SJC (findfile "SJC.lin")) ;states the file to be looked for
(if (= SJC (findfile "SJC.lin")) ;looks for the file stated above
(progn ;says if the file is found do these things
(setvar "expert" 3)
(setvar "filedia" 0)
(command "._-linetype" "l" "DASHED2" SJC "")
(setvar "expert" oldexpert)
(setvar "filedia" oldfiledia)
(princ
(strcat "\nlinetype DASHED2 in file SJC.lin was loaded.") ;tells the user the file was found and loaded
)
)
(princ (strcat "\nlinetype file SJC.lin was not found!")) ;tells the user the file was not found or loaded
)
;;set layer and draw polyline
(command "-layer" "m" "-M-AREA" "C" "20"
"-M-AREA" "Lt" "DASHED2" "-M-AREA" "p"
"n" "-M-AREA" ""
) ;creates new layer -M-AREA
(pln) ;runs polyline loop
(setvar "clayer" oldclayer)
(princ) ;exit cleanly
)