bono05 Posted August 8, 2012 Posted August 8, 2012 Hi guys, So if possible i would like first make a selection of blocks (#1) and then select another block (#2) with a different rotation... and at the end my selection of blocks (#1) have the same rotation as the another block (#2). I'll do my best to explain... Bono. Quote
MSasu Posted August 8, 2012 Posted August 8, 2012 Yes, this is possible: ; Match Block Rotation routine (08-VIII-2012) (defun c:MBR( / ssetBlockSource ssetBlockTarget theBlock assocList theRotation ) (prompt "\nSelect source block to copy rotation from...") (if (setq ssetBlockSource (ssget "_:S:E" '((0 . "INSERT")))) (progn (setq theBlock (ssname ssetBlockSource 0) assocList (entget theBlock) theRotation (assoc 50 assocList)) (prompt "\nSelect target block to copy rotation to...") (while (setq ssetBlockTarget (ssget "_:S:E" '((0 . "INSERT")))) (setq theBlock (ssname ssetBlockTarget 0) assocList (entget theBlock)) (entmod (subst theRotation (assoc 50 assocList) assocList)) ) ) ) (princ) ) Quote
Tharwat Posted August 8, 2012 Posted August 8, 2012 (defun c:Test (/ s ss i sn) (if (and (setq s (ssget "_+.:S" '((0 . "INSERT")))) (setq ss (ssget ":L" '((0 . "INSERT")))) ) (repeat (setq i (sslength ss)) (setq sn (ssname ss (setq i (1- i)))) (entmod (subst (assoc 50 (entget (ssname s 0))) (assoc 50 (entget sn)) (entget sn) ) ) ) (princ) ) (princ) ) Quote
bono05 Posted August 8, 2012 Author Posted August 8, 2012 Thanks to Msasu and Tharwat!!!! It's just wat i need. Long live to cadtutor!!!! Quote
mikitari Posted November 19, 2012 Posted November 19, 2012 Hello, I am sorry if I break the forum rule adding to this thread, but this is similar idea: have you got an idea for a lisp to add certain angle value to current block angle? I have various blocks inserts of different angle, and I need to rotate some of them by 180 degrees. The idea is to do this by running a command and a single click on the block, to have it rotated by extra angle defined at the beginning of the command, and repeat. Any idea? Quote
Lee Mac Posted November 19, 2012 Posted November 19, 2012 Have you got an idea for a lisp to add certain angle value to current block angle? In this code: http://www.cadtutor.net/forum/showthread.php?46627-Flip-Multiple-Texts-180-Degrees&p=507691&viewfull=1#post507691 Change: "TEXT,MTEXT" to: "INSERT" Quote
mikitari Posted November 19, 2012 Posted November 19, 2012 Hi Lee Mac, Thank you for pointing to this next thread! I will check this out on blocks. Just to be clear: Could you please confirm, that the lisp works by means of rotating and not flipping (not the mirror effect). Best regards! Quote
Lee Mac Posted November 19, 2012 Posted November 19, 2012 Could you please confirm, that the lisp works by means of rotating and not flipping (not the mirror effect). Yes ........ Quote
mikitari Posted November 27, 2012 Posted November 27, 2012 Both rutines from the other thread work great! Thank you! Best regards, M. Quote
Lee Mac Posted November 27, 2012 Posted November 27, 2012 Both rutines from the other thread work great!Thank you! Excellent, you're welcome 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.