TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mohan on September 25, 2018, 05:14:11 AM
-
Help to Combind 2 lisps
(defun c:AlignView (/ p1 p2 ang)
(and
(setq p1 (getpoint "\nFirst alignment point: "))
(setq p2 (getpoint p1 "\nSecond alignment point: "))
(setq ang (- (angle (trans p1 1 0) (trans p2 1 0))))
(command "_.dview" "" "_twist" (angtos ang (getvar 'aunits) 16) "")
)
(princ)
)
(defun c:zo()(command "._zoom" "_end" pause "_end"))
thanks
-
(defun c:combo()
(c:alignview)
(c:zoo)
)
(defun c:reverse-combo()
(c:zoo)
(c:alignview)
)
-
ok please help to Combine below two lisps as one
(defun c:AlignView (/ p1 p2 ang)
(and
(setq p1 (getpoint "\nFirst alignment point: "))
(setq p2 (getpoint p1 "\nSecond alignment point: "))
(setq ang (- (angle (trans p1 1 0) (trans p2 1 0))))
(command "_.dview" "" "_twist" (angtos ang (getvar 'aunits) 16) "")
)
(princ)
)
(defun c:zw (/ pt1 pt2)
(if
(and
(setq pt1 (getpoint "\nSelect First Window Point: "))
(setq pt1 (osnap pt1 "_end"))
(setq pt2 (getpoint "\nSelect Second Window Point: "))
(setq pt2 (osnap pt2 "_end"))
)
(command "._zoom" "_w" "_non" pt1 "_non" pt2) ; end zoom
)
(princ)
) ; end program
look forward to here from you soon as possible
-
ok please help to Combine below two lisps as one
(defun c:AlignView (/ p1 p2 ang)
(and
(setq p1 (getpoint "\nFirst alignment point: "))
(setq p2 (getpoint p1 "\nSecond alignment point: "))
(setq ang (- (angle (trans p1 1 0) (trans p2 1 0))))
(command "_.dview" "" "_twist" (angtos ang (getvar 'aunits) 16) "")
)
(princ)
)
(defun c:zw (/ pt1 pt2)
(if
(and
(setq pt1 (getpoint "\nSelect First Window Point: "))
(setq pt1 (osnap pt1 "_end"))
(setq pt2 (getpoint "\nSelect Second Window Point: "))
(setq pt2 (osnap pt2 "_end"))
)
(command "._zoom" "_w" "_non" pt1 "_non" pt2) ; end zoom
)
(princ)
) ; end program
look forward to here from you soon as possible
Follow the advice from kpblc in the post above. It's nearly identical
-
with one command
-
Did you look how kpblc's function operated? With his "combo" and "reverse-combo" he is executing one lisp function and then immediately following with a second.
-
Not Lisp but worth it! This Macro will help some. It ops 3 commands, turn boundary to region and back, gets a boundary, then issues move of it [last] works well for me! Try it..
(setvar "hpbound" 0) Bo \ (setvar "hpbound" 1) ^C^Cmove;p;l;;