(defun c:tsb ( / SetEntityTransparency ss transparency i ) ;;; Set Transparency of all entities in drawing to ByLayer. Modified by Marko Ribar 2015
;;; Based on Topic http://www.theswamp.org/index.php?topic=44517.msg497697#msg497697
(vl-load-com)

(defun SetEntityTransparency ( entity transparency / typ )
(if (or (and (= 'STR (setq typ (type transparency)))
(= "BYLAYER" (strcase transparency))
)
(and (= 'INT typ) (vla-object entity)
transparency
)
)
)
)
)

(if (and
(setq ss (ssget "_A"))
(setq transparency "ByLayer")
)
(repeat (setq i (sslength ss))
(SetEntityTransparency (ssname ss (setq i (1- i))) transparency)
)
)
(princ)
)
(c:tsb)

Advertisements