jim78b Posted 13 hours ago Posted 13 hours ago (defun c:setbyblock ( / _byblock e n x a sel c) (defun _byblock ( n l / a e x ) (if (and (setq e (tblobjname "BLOCK" n)) (not (member n l))) (while (setq e (entnext e)) (setq x (entget e)) (if (setq a (assoc 420 x)) (setq x (vl-remove (assoc 420 x) x)) ) (if (setq a (assoc 62 x)) (entmod (subst '(62 . 0) a x)) (entmod (append x '((62 . 0)))) ) (if (= "INSERT" (cdr (assoc 0 x))) (_byblock (cdr (assoc 2 x)) (cons n l)) ) ) ) nil ) (prompt "\nSelect Blocks: ") (setq sel (ssget (list (cons 0 "INSERT")))) (setq c 0) (repeat (sslength sel) (setq n (ssname sel c)) (_byblock (cdr (assoc 2 (entget n))) nil) (setq c (1+ c)) ) (command "_.regen") (princ) ) Merry Christmas and best wishes to all, I would kindly need you to change this code so that it also makes the byblock transparency in addition to the color of the blocks Quote
Steven P Posted 4 hours ago Posted 4 hours ago Holidays... CAD is off, but if it is like layer transparency then you might need to look at extended entity definitions, I think Lee Mac had something somewhere for layers that might apply - check his website or search on this forum. Could always double check, set a block to a transparency, I tend to use 12.3456 because that number is easy to spot, and do an (entget(car(entsel))) to the block and see if you can spot an part of the definition with 12.3456.. and that is what to change Quote
jim78b Posted 3 hours ago Author Posted 3 hours ago Can you modify the code please ? I am not familiar with lisp. Only want tò setbyblock block .color: setbyblock Transparency: byblock Quote
BIGAL Posted 45 minutes ago Posted 45 minutes ago "Not familiar with lisp" but you have 662 posts time to start learning and experimenting. Quote
rlx Posted 31 minutes ago Posted 31 minutes ago I have to agree with Bigal about to (new)bee or not to (new)bee but to give you an idea ; (setq val (getentitytransparency (car (entsel)))) (defun getentitytransparency ( ent ) (cond ((= 'vla-object (type ent))(vla-get-entitytransparency ent)) ((= 'ename (type ent))(getentitytransparency (vlax-ename->vla-object ent))))) ; (< lower-limit test-number upper-limit) ; (putentitytransparency (car (entsel)) "ByBlock") (putentitytransparency (car (entsel)) 100) (defun putentitytransparency (e v / i o) (cond ((null v)(setq v "ByLayer"))((and (numberp v)(< 0 v 90))(setq v (itoa (fix v)))) ((and (= (type v) 'STR) (distof v) (>= 0 (setq i (fix (distof v))) 90))(setq v (itoa i))) ((and (= (type v) 'STR) (member (strcase v t)'("bylayer" "byblock"))) v)(t (setq v "0"))) (if (setq o (e->o e))(vla-put-entitytransparency o v))) 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.