Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lisp program error

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
MKH-VB
1980 Views, 9 Replies

lisp program error

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

 

 

mkh
9 REPLIES 9
Message 2 of 10
hmsilva
in reply to: MKH-VB


@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

EESignature

Message 3 of 10
Kent1Cooper
in reply to: MKH-VB

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.

Kent Cooper, AIA
Message 4 of 10
MKH-VB
in reply to: hmsilva

Henrique....
I removed the qui and then the program output changes. It tries to draw the arcs, but they are not drawn correctly. thanks for the reply.
mkh
Message 5 of 10
hmsilva
in reply to: MKH-VB

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

EESignature

Message 6 of 10
MKH-VB
in reply to: hmsilva

yes, thank you so much!
mkh
Message 7 of 10
hmsilva
in reply to: MKH-VB


@MKH-VB wrote:
yes, thank you so much!

You're welcome, mkh!
Glad I could help

Henrique

EESignature

Message 8 of 10
Kent1Cooper
in reply to: Kent1Cooper


@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:

EndPipe.png

Kent Cooper, AIA
Message 9 of 10
MKH-VB
in reply to: Kent1Cooper

Kent....
I tried yours this morning. It is great! Thanks for the tip.
MKH
mkh
Message 10 of 10
_Tharwat
in reply to: MKH-VB

Hi,

 

A bit late to the party, try this old program of mine FROM HERE

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report