Author Topic: [LISP] Transparency greater than 90  (Read 2572 times)

0 Members and 1 Guest are viewing this topic.

delkov

  • Guest
[LISP] Transparency greater than 90
« 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.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: [LISP] Transparency greater than 90
« Reply #1 on: October 12, 2015, 07:46:18 AM »
Set the object colour to an RGB colour equal to the drawing background colour?

delkov

  • Guest
Re: [LISP] Transparency greater than 90
« Reply #2 on: October 12, 2015, 08:05:09 AM »
Good idea, but I'll use a varicolored backing PDF :(

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: [LISP] Transparency greater than 90
« Reply #3 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)
  )

delkov

  • Guest
Re: [LISP] Transparency greater than 90
« Reply #4 on: October 12, 2015, 08:25:51 AM »
It perfectly works!
Thanks, man.

Stefan

  • Bull Frog
  • Posts: 319
  • The most I miss IRL is the Undo button
Re: [LISP] Transparency greater than 90
« Reply #5 on: October 12, 2015, 08:29:04 AM »
It perfectly works!
Thanks, man.
You're welcome!