Images Toggle

Images Toggle

richie_hodgson
Collaborator Collaborator
767 Views
5 Replies
Message 1 of 6

Images Toggle

richie_hodgson
Collaborator
Collaborator

Ok it all seemed so easy, but I seem to be getting nowhere. I would like a lisp to toggle all images in the drawing between loaded or unloaded

 

I tried

 

(vl-load-com)
(defun c:IMT (/ i lst obj ss)
  (setq lst "")
  (prompt "\nSelecting All Images to Unload: ")
  (if (setq ss (ssget "x" (list (cons 0 "IMAGE"))))
    (progn
      (repeat (setq i (sslength ss))
        (setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i))))
              lst (strcat lst "," (vla-get-name obj))
        )
      )
      (vl-cmdf "-Image" "_U" lst)
    )
  )
  (princ)
)

 

Just to unload all of them, but it worked once then not again. Has anyone got a working piece of code to toggle between reload and unload, or something that will unload and reload seperately

Richie
0 Likes
Accepted solutions (3)
768 Views
5 Replies
Replies (5)
Message 2 of 6

paullimapa
Mentor
Mentor
Accepted solution

Should be no special function needed:

To Unload All Images at command prompt type:

-Image

U

*

 

To Reload All Images at command prompt type:

-Image

R

*

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales |Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 6

richie_hodgson
Collaborator
Collaborator
Accepted solution

That gave me another idea, cool.

Richie
0 Likes
Message 4 of 6

braudpat
Mentor
Mentor
Accepted solution

 

Hello

 

For this purpose :

Unload / Reload ALL Images

Unload / Reload ALL Xrefs

 

I use a nice routine from Gilles (gile)

 

I0 : ALL Images OFF

I1 : ALL Images ON

X0 : ALL XREFs OFF

X1 : ALL XREFs ON

 

Thanks to Gilles (a french Expert Developer)

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


0 Likes
Message 5 of 6

richie_hodgson
Collaborator
Collaborator

Hi there

 

That looks very interesting, will test it later today.  Thank you in advance.

 

Richie

 

 

Richie
0 Likes
Message 6 of 6

richie_hodgson
Collaborator
Collaborator
Very cool, will have to check how the image part works as I am not sure about that bit of the code.
Richie
0 Likes