Image background color by lisp

Image background color by lisp

a.dellaragione
Participant Participant
659 Views
2 Replies
Message 1 of 3

Image background color by lisp

a.dellaragione
Participant
Participant

Hi,

I have a lot of DWGs files that contain some raster images and I would like to automatically set the transparency color 

(maybe by a lisp or some code).

Someone can help me?

 Thanks  a lot.

0 Likes
660 Views
2 Replies
Replies (2)
Message 2 of 3

jrreid
Advocate
Advocate

I have a similar setup for Images to Turn the Frame Image off by clicking a Button I made.

Type CUI and you can easily make your own Button and then Drag and Drop it onto your screen.

No lisp file needed.

 

jrreid_0-1630612084257.pngjrreid_1-1630612128883.png

My code is Image Frame Off.  ^C^Cimageframe;0;

But you can make one by adding all of the commands you use to make your Image Transparent.

This is one way to change the layer color:    ^C^C-la;c;211;;;

 

If I want my layer to be transparent this is what I did manually:

Command:
-LAYER

Current layer: "A-DETL-THIN"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: tr
Enter transparency value (0-90): 50
Enter name list of layer(s) for transparency 50% <A-DETL-THIN>:
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]:

 

Now to put it in the Button:  ^C^C-la;TR;50;;;

If you need to set your layer first:  ^C^C-la;S;YOURLAYER-TO-BE-TRANS;TR;50;;;

If you want to set the original layer back just add it:  ^C^C-la;S;YOURLAYER-TO-BE-TRANS;TR;50;S:ORIG-LAYER;;;

Make a new Box Image or use one that is there already drawn up.

 

Should be easy to do.

 

Hope this helps.

 

JRR.

 

0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

Maybe this as an example you can add the input value etc

 

(setq obj (vlax-ename->vla-object (car  (entsel "Pick image"))))
(vla-put-entitytransparency obj 50)