got a simple lisp that i use quite a bit. Works fine in 2014, but get a "bad argument type" when trying to use in 2016. I've attached incase someone is interested in trying to fix it. Thanks
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
@MKH-VB wrote:
got a simple lisp that i use quite a bit. Works fine in 2014, but get a "bad argument type" when trying to use in 2016. I've attached incase someone is interested in trying to fix it. Thanks
Hi MKH-VB,
I don't have 2016 in this laptop, to test your code, but in 2015 it runs without an error.
If I'm not mistaken, in 2016 the QUIck snap mode, does not exist...
Try to change
(setq pt1 (osnap (cadr first) "qui,end")
pt2 (osnap (cadr second) "qui,end")
)
to
(setq pt1 (osnap (cadr first) "end")
pt2 (osnap (cadr second) "end")
)
Hope this helps,
Henrique
You might be interested in the routine I wrote partially in response to a shortcoming in that one, available here [see the first Comment about the shortcoming]. It also offers additional options for what to draw across the end, and has other benefits [for instance, it requires the ends to be parallel and aligned, whereas endpipe.lsp will let you pick ends that aren't, and will draw a skewed thingie]. Read the description there, and the commentary at the top of the file.
Hi mkh,
and like this, it works as expected?
(defun c:endpipe (/ plwid first second pt1 pt2 ang dis pt3 layr entl) (setq olderr *error* *error* pipe_err) (setq plwid (getvar"plinewid")) (setvar"plinewid" 0) (while (not (setq first (entsel "\nPick first endpoint: "))) (prompt "\nNo endpoint found. ") ) (while (not (setq second (entsel "\nPick second endpoint: "))) (prompt "\nNo endpoint found. ") ) (if second (progn (setq pt1 (osnap (cadr first) "end") pt2 (osnap (cadr second) "end") ) (setq ang (angle pt1 pt2) dis (distance pt1 pt2) pt3 (polar pt1 ang (/ dis 2.0)) ) (command "pline" "_NON" pt1 "arc" "a" "100" "_NON" pt3 "_NON" pt2 "a" "-100" "_NON" pt3 "")) ) (setq layr (cdr (assoc 8 (entget (car first)))) entl (entget (entlast)) ) (setq entl (subst (cons 8 layr)(assoc 8 entl) entl)) (entmod entl) (setvar "plinewid" plwid) (setq *error* olderr) (princ) ) (defun pipe_err (s) (if (/= s "Function cancelled") (princ (strcat "\nError: "s)) ) (setvar"plinewid" plwid) (if olderr (setq *error* olderr)) (princ) )
Hope this helps,
Henrique
@Kent1Cooper wrote:
.... the routine I wrote partially in response to a shortcoming in that one, available here [see the first Comment about the shortcoming]. It also offers additional options for what to draw across the end, and has other benefits [for instance, it requires the ends to be parallel and aligned, whereas endpipe.lsp will let you pick ends that aren't, and will draw a skewed thingie]. ....
Some of the kinds of inappropriate results that endpipe can give you ["facing" the wrong way, accepting non-aligned or non-parallel objects], that the Pipe option in CapEnd.lsp [in the link] was designed to prevent:
Can't find what you're looking for? Ask the community or share your knowledge.