Jump to content

Lisp works in Vs. 2015 but not in Vs. 2016?


pioptl

Recommended Posts

I have a lisp routine that I use extensively, don't know who wrote it or where it came from but have been using it for 10-15 years. Not real lisp savy so I'm asking if anyone knows why this may work fine in 2015 but not in 20016. When I use it in 2016 it returns "invalid object" every time, no matter what type of object I pick. This lisp simply sets the snapang to the angle of a selected object.

Any help would be appreciated,

Thanks

 

 

;;   SNAPANG COMMAND
;;   ALIOUS SHORTCUT
; I have no idea who wrote this.
(defun C:SX (/ r e p1 p2)
 (graphscr)
 (initget "Entity")
 (setq r
 (getangle "\nSnap rotation angle/<Entity>: "))
 (cond
    (  (numberp r)
     	(setvar "snapang" r))
    (  (and (or (not r) (eq r "Entity"))
            (setq e (entsel))
            (setq p1 (osnap (cadr e) "qui,end"))
            (setq p2 (osnap (cadr e) "qui,mid")))
       (setvar "snapang" (angle p1 p2)))
    (t (princ "\nInvalid selection.")))
 (princ)
)

Link to comment
Share on other sites

Try it using not "qui,end" / "qui,mid"

but rather just "end" / "mid"

 

While "qui,end,mid" was still recognized in 2015 the "qui" part has been obsolete for many years. "qui,end,mid" & "end,mid" do the same thing in 2015, in 2016 they finally stopped recognizing "qui" as an osnap. May be because OSMODE has been redone when they added the Geometric CEnter osnap.

 

On the same theme, you might find my Cursor Rotate program useful. :thumbsup:

Nice, I'll add that to my Snap Angle drop-down.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...