I am looking for a lisp routine that will draw a zigzag line that is a 2" polyline. It needs to be two inches thick no matter what the scale. I would like to use for single line flex. I am posting my flex routine below if you would like to use it. this routine draw a single line and then splines it, you then have the option to touch it and turn it into double line flex. I would like the single line to draw the zigzag and then have the option to go double line after that. You can make any block you like for you double line flex. This routine was written by Joe Healy about 10 years ago and still works great. Thanks for any help.
Code:
;routine to draw FLEX ONLY FLEXONLY.LSP
(defun c:FLEX2 ()
(setq CLAY (getvar "clayer")
ss1 (ssadd)
)
(setq SIZET (ureal 1 "" "Enter flex size" SIZET))
(cond
((= SIZET 6.0) (setq DSIZE "J6"))
((= SIZET 8.0) (setq DSIZE "J8"))
((= SIZET 10.0)(setq DSIZE "J10"))
((= SIZET 12.0)(setq DSIZE "J12"))
((= SIZET 14.0)(setq DSIZE "J14"))
((= SIZET 16.0)(setq DSIZE "J16"))
((= SIZET 18.0)(setq DSIZE "J18"))
(T nil)
)
(command "layer" "m" "M-DUCT-FLEX" "c" "12" "" "")
(initget 1)
(setq PT1 (getpoint "\nFrom point: "))
(setq PTb pt1)
(while (/= nil (setq PT2 (getpoint PT1 "\nTo point: ")))
(command "line" PT1 PT2 "")
; (IF (/= NIL PT1) (SETQ PTB PT1))
(setq ss1 (ssadd (cdr (assoc -1 (entget (entlast)))) ss1)
PT1 PT2
)
)
(flatten ss1)
(command "pedit" "l" "y" "j" ss1 "" "s" "lt" "on" "")
(setq enjunk (entlast))
(command "measure" pAUSE "b" dsize "y" "3.5")
(command "erase" enjunk "")
(command "layer" "s" CLAY "")
(princ)
);
(defun flatten (lss)
(setq hite (getvar "elevation")
flatcnt 0)
(repeat (sslength lss)
(setq len (entget (ssname lss flatcnt))
ose (caddr (cdr (assoc 10 len)))
oee (caddr (cdr (assoc 11 len)))
nsp (subst hite ose (cdr (assoc 10 len)))
nep (subst hite oee (cdr (assoc 11 len)))
len (subst (cons 10 nsp) (assoc 10 len) len)
len (subst (cons 11 nep) (assoc 11 len) len)
);setq
(entmod len)
(setq flatcnt (1+ flatcnt))
);repeat
(princ)
);defun flat
[ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]