OSNAP Lisp function not working same as AutoCAD

I have a routine that I use frequently in AutoCAD and I'm trying to port it to Bricscad.  I've isolated a problem section and have made it into a small routine to illustrate the problem.  Here it is:

 

(defun c:brk () (setvar "BlipMode" 1)   (setvar "OsMode" 0) (while (not (setq p1 (osnap (cadr (setq wall-entity (entsel "\nPoint on wall: "))) "near")) )       (princ "\nInvalid ...") )(princ "\n p1 =") (princ p1)   (initget 6) (setq p2 (osnap p1 "midp"))     (setq   p3 (osnap p1 "endp"))(princ "\n p1 =") (princ p1) (princ "  p2 =") (princ p2) (princ "  p3 =") (princ p3) (princ))

If you run this in AutoCAD, p2 and p2 both get defined as points.  In Bricscad, they both come out as NIL.  That is causing problems for the rest of the routine that I am using.

 

Any idea why this is, or how to fix it?

 

Thanks.

 

Comments

  • Who knows why, but sometime fairly recently osnaps within lisps changed to 3 letters - midp became mid, perp became per etc.

    I believe Bcad did it in response to Acad, perhaps you moved from an earlier model of Acad.

    Sometimes I wonder where Autocad is taking us.

  • That fixed it!

     

    Thanks!

  • Thanks to John TeSelle and John Gaunt for the question and the answer! That is exactly the kind of issue that would drive me crazy for hours, maybe days.

  • I too wish to add my thanks to both Johns - had the same problem and after about 20 minutes of fruitless experimenting found your solution through a Google search.  Thanks!

  • That's how I found out, great to be able to help as others have helped me.

    I had trouble believing "end" would work, as it used to be a command which could mean more like the end of your current intentions for the file than endpoint.

This discussion has been closed.