Jump to content

Recommended Posts

Posted

I found this lisp somewhere here in this forum.

Does anyone know how to translate it to VBA code?

Thanks

 

;;*********************************************
;;
;; Created: Author Unknown.
;;
;;
;**************NEW ROTATE**********************
;
;;; Command Line Syntax: RT
;;; Use this routine to change the angle of the crosshairs,
;;; by clicking on an object that is at the desired angle or
;;; by entering an angle of degrees at the command line.
;;; A positive number turns the crosshairs counter-clockwise.
;;; A negative number turns the crosshairs clockwise.
;
(defun c:rt ( / 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)
)
;;;
;;;

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...