PDA

View Full Version : Help with autolisp (2 lisp programs in one lisp execution)



javier-perez1956746375
2017-06-14, 08:26 PM
Hi to all My name Javier
Thanks in advance to all that help with this one.
I have a lisp program that use on every drawing, its my os1 lisp (osnaps). My problem is that when i execute another lisp program, my osnap lisp turn off and i have to invoke the os1 again. Can I include my os1 lisp at the end of other lisp programs. I would like to have the os1 execute after other lisp program executes. I included a lisp program to draw T profile and the os1 lisp. I would like for the os1 to execute after the TEE Profile is executed, so that i don't have to execute the os1 every time i execute a lisp program.
Thanks

Tom Beauford
2017-06-15, 07:40 PM
Try:
(defun c:T-profile ( / osmode pt1 CL SH T1 T2 pt2 pt3 pt4 pt5 pt6 pt7 pt8)
(command "._layer" "_M" "SECTION" "")
(setq osmode (getvar "osmode" ))
(setvar "osmode" 0)
(Setq pt1 (getpoint "\nEnter the point: ") ;Starting point;
CL (getdist "\nEnter the Cap length: ")
SH (getdist "\nEnter the Stem Height: ")
T1 (getdist "\nEnter the Stem Thickness: T1 ")
T2 (getdist "\nEnter the Cap Thickness: T2 ")
pt2 (polar pt1 0 t1)
pt3 (polar pt2 (/ pi 2.0) (- SH T2))
pt4 (polar pt3 0 (+(/ CL 2) (-(/ T1 2))))
pt5 (polar pt4 (/ pi 2.0) T2)
pt6 (polar pt5 pi CL)
pt7 (polar pt6 (/(* pi 3)2) t2)
pt8 (polar pt7 0 (- (/ CL 2) (/ T1 2)))
)
(command "pline" pt1 pt2 pt3 pt4 pt5 pt6 pt7 pt8 pt1 "")
(setvar "osmode" osmode)
(princ)
)