Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Using transparency 'byblock' (a nice tool)

Hi ,

Here is a demonstation of a great code that will set transparency of blocks as 'byblock'
I use transparency many times to get a certain display in a 3D view or in a drawing.
If you set all objects 3D object byblock the xref as a whole can be made transparant. I think that is powerful.

I didn't programm it myself, just wanted to shared this great tool here for you guys.
If you have any good ideas of suggestions for imporvement , please do.


;author: Roy_043
; (NestedPutProp "MyBlk" 'entitytransparency "BYBLOCK")
; (NestedPutProp "MyBlk" 'color 3)
(defun NestedPutProp (nme prop val / blk)
(setq blk
(vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
(= :vlax-false (vla-get-islayout blk))
(= :vlax-false (vla-get-isxref blk))
(vlax-for obj blk (vlax-put obj prop val))

(defun KGA_Conv_Pickset_To_ObjectList (ss / i ret)
(if ss
(repeat (setq i (sslength ss))
(setq ret (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) ret))

(defun C:TRBB ( / doc doneLst ss)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vla-endundomark doc)
(vla-startundomark doc)
(if (setq ss (ssget '((0 . "INSERT"))))
(foreach obj (KGA_Conv_Pickset_To_ObjectList ss)
(if (not (vl-position (strcase (vla-get-name obj)) doneLst))
(NestedPutProp (vla-get-name obj) 'entitytransparency "BYBLOCK")
(setq doneLst (cons (strcase (vla-get-name obj)) doneLst))
(vla-regen doc acactiveviewport)
(vla-endundomark doc)

This discussion has been closed.
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam