LISP FOR HATCH TRANSPARANCY

LISP FOR HATCH TRANSPARANCY

larsr2866
Enthusiast Enthusiast
1,623 Views
4 Replies
Message 1 of 5

LISP FOR HATCH TRANSPARANCY

larsr2866
Enthusiast
Enthusiast

Good afternoon everyone,

 

I have a question. I have a lisp code to change all my hatches to a specific color. But is it also possible to give all these hatches a transparancy of 60%?


  (if (setq sst (acet-ss-ssget-filter ss '((0 . "HATCH"))))
    (command "_.CHPROP" sst "" "_Color" "_True" '"300,297,250" ""))

 

 

Thanks in advance.

Lars

0 Likes
Accepted solutions (2)
1,624 Views
4 Replies
Replies (4)
Message 2 of 5

dbhunia
Advisor
Advisor
Accepted solution

Try like this.......

 

 

(if (setq sst (ssget '((0 . "HATCH"))))
  (progn 
    (command "_.CHPROP" sst "" "_Color" "_True" "255,255,255" "");; R,G,B color value should be 0 to 255
    (repeat (setq n (sslength sst))
      (setq itm (ssname sst (setq n (1- n))))
      (setq obj (vlax-ename->vla-object itm))
      (if (vlax-write-enabled-p obj) (vla-put-entitytransparency obj 60));; Here Transparency is 60%
    )
  )
)

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 3 of 5

larsr2866
Enthusiast
Enthusiast

Thank you for your answer.

Ik works, but it doesn't change it automatically to all hatches. I have to select the hatches first.

Can i get this working without the user input?

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

 Best if you look eg. HERE to learn how to fix it by yourself. 

0 Likes
Message 5 of 5

larsr2866
Enthusiast
Enthusiast

Thanks for the link, BeekeeCZ.

The ssget "_A" ' did the trick 🙂

0 Likes