KeithJaw Posted July 28, 2022 Posted July 28, 2022 Coming back to Autocad after some time away, I used to have a LISP routine that I had written myself. But I've lost it, and have forgotten how to the programming was done. The routine would request entities to rotate, and ask for a rotation point, but would then make the reference point equal to the rotation point, thus skipping an annoying stage. Can somebody point the way for me to do this? Thanks in advance, Keith Quote
mhupp Posted July 28, 2022 Posted July 28, 2022 (edited) If rotation point = ref point just use rotate command This is what I use to make a rotation with reference. Giving you another one that I don't use as often but when I do it saves time. usually use it on block to flip them around their mid point. ;;----------------------------------------------------------------------------;; ;; ROTATE WITH REFERENCE (defun C:RH (/ SS) (if (setq SS (ssget ":L")) (vl-cmdf "_.Rotate" SS "" Pause "R" "@" Pause Pause) (prompt "\nNothing Selected or Entity's on Locked Layer") ) (princ) ) ;;----------------------------------------------------------------------------;; ;; ROTATE MULTIPLE ENTITY'S AROUND THEIR MIDPOINT (defun C:ROB (/ SS LL UR MPT) (vl-load-com) (if (setq SS (ssget ":L")) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq obj (vlax-ename->vla-object ent)) (vla-getboundingbox obj 'minpt 'maxpt) (setq LL (vlax-safearray->list minpt) UR (vlax-safearray->list maxpt) MPT (mapcar '/ (mapcar '+ LL UR) '(2 2 2)) ) (vl-cmdf "_.Rotate" ent "" "_non" MPT pause) ) ) (princ) ) Edited July 28, 2022 by mhupp 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.