TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: delkov on October 12, 2015, 07:21:19 AM

Title: [LISP] Transparency greater than 90
Post by: delkov on October 12, 2015, 07:21:19 AM
Hi to all.
My trouble is that I want to make invisible some object (e.g spline), but with opportunity to click on it by mouse to change it and etc.
My solution is like this

(vla-put-entitytransparency obj LEVEL)

But max value of "LEVEL" is only 90..


How can I get around it?
Or there are another ways?


Thanks.
Title: Re: [LISP] Transparency greater than 90
Post by: Lee Mac on October 12, 2015, 07:46:18 AM
Set the object colour to an RGB colour equal to the drawing background colour?
Title: Re: [LISP] Transparency greater than 90
Post by: delkov on October 12, 2015, 08:05:09 AM
Good idea, but I'll use a varicolored backing PDF :(
Title: Re: [LISP] Transparency greater than 90
Post by: Stefan on October 12, 2015, 08:14:47 AM
You can set the transparency higher than 90 by lisp.

Code: [Select]
(defun c:test ( / ss n i)
  (if
    (and
      (setq ss (ssget ":L"))
      (progn
        (while
          (and
            (setq n (getint "\nTransparency [0-99]: "))
            (not (<= 0 n 99))
          )
           (princ "\nInvalid value. Try again.")
        )
        n
      )
      (setq n (list (cons 440 (+ (lsh 2 24) (fix (- 255 (* n 2.55)))))))
    )
    (repeat (setq i (sslength ss))
      (entmod
        (append
          (entget (ssname ss (setq i (1- i))))
          n
          )
        )
      )
    )
  (princ)
  )
Title: Re: [LISP] Transparency greater than 90
Post by: delkov on October 12, 2015, 08:25:51 AM
It perfectly works!
Thanks, man.
Title: Re: [LISP] Transparency greater than 90
Post by: Stefan on October 12, 2015, 08:29:04 AM
It perfectly works!
Thanks, man.
You're welcome!