Sebi Posted January 12, 2024 Posted January 12, 2024 (edited) Lisp for match rotation angle between objects (works on multileaders) - combined from 2 found lisps on the internet, with the help of A.I. ;;; Rotate by existing object/angle - Debugging (including Multileaders) (vl-load-com) (defun C:RB (/ sourceObj rot targetObj) (defun convert-to-double (angle) (vl-catch-all-apply 'rtos (list angle 2 2)) ) (setq sourceObj (car (entsel "\nSelect the source object for rotation < specify manually >: "))) (if (setq sourceObj (vlax-ename->vla-object sourceObj)) (progn (setq rot (vla-get-rotation sourceObj)) (setq targetObj (car (entsel "\nSelect target object to be rotated: "))) (if (setq targetObj (vlax-ename->vla-object targetObj)) (if (not (vl-catch-all-error-p (cond ((and (eq (vla-get-objectname targetObj) "AcDbMLeader") (eq (vla-get-contenttype targetObj) 2)) (progn (vla-put-textrotation targetObj (convert-to-double rot)) (vla-put-rotation targetObj (convert-to-double rot)) )) ; Rotate multileader text and block to the source object's rotation (t (vla-put-rotation targetObj (convert-to-double rot)) ; Rotate other objects ) ) )) (prompt "\nRotation applied successfully.") (prompt "\nCannot apply rotation angle!") ) ) ) (prompt "\nError: Source object not selected.") ) (princ) ) Rotate Object by another's angle-RB.lsp Edited January 12, 2024 by SLW210 Added Code Tags!! Quote
BIGAL Posted January 13, 2024 Posted January 13, 2024 Just a quick one a circle, line, arc etc do not have a rotation property. So if for multi leaders then can change then entsel to a ssget and only pick mleaders. Quote
Recommended Posts
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.