Jump to content

Image Frame


MiGo

Recommended Posts

How does one capture the imageframe setting and set something to it?

 

(setq Iframe...

 

I'm after turning the image frame on and then returning it to it's original number, but i'm not sure how to capture the original number.

Link to comment
Share on other sites

There are no variables for this command

so you may have to do it like this:

 

(setq IFRAME-ON (command "_.IMAGEFRAME" "ON"))

(setq IFRAME-OFF (command "_.IMAGEFRAME" "OFF"))

 

The Buzzard

Link to comment
Share on other sites

When using imageframe the options are 0, 1, 2 so the whole on/off part won't work. On every drawing that I have dealt with the imageframe has always been set to zero, but I just wanted to try and capture that integer and set it back.

Link to comment
Share on other sites

Once again but this time from AutoCAD help section

 

Commands IMAGEFRAME

Controls whether image frames are displayed or hidden from view

System Variables No entries.

 

There are no variables unless you set to a variable yourself.

Link to comment
Share on other sites

IMAGEHLT set to zero makes it so the border hightlits if on when over the image border. If set to one it makes a cross pattern over the image when selected or if hovering over border that is set at 45deg box pattern.

Link to comment
Share on other sites

Try this

 

(defun C:IMGFRAME ()
 (setq IFRAME (getint "\nEnter An Integer:"))
 (progn
   (if 
     (= IFRAME 1)
     (command "_.IMAGEFRAME" "ON")
   )
   (if 
     (= IFRAME 0)
     (command "_.IMAGEFRAME" "OFF")
   )
 )
)

Link to comment
Share on other sites

 
(setq iframe (cdr (assoc 70 (dictsearch (namedobjdict) "ACAD_IMAGE_VARS"))))

 

 

0 => Imageframe set to Off

1 => Imageframe set to On

3 => Imageframe set to On but will not plot

Link to comment
Share on other sites

Try this

 

(defun C:IMGFRAME ()
 (setq IFRAME (getint "\nEnter An Integer:"))
 (progn
   (if 
     (= IFRAME 1)
     (command "_.IMAGEFRAME" "ON")
   )
   (if 
     (= IFRAME 0)
     (command "_.IMAGEFRAME" "OFF")
   )
 )
)

 

 

Buzzard, I'd be more inclined to use COND in this instance:

 

(defun C:IMGFRAME  (/ IFRAME)
 (initget 5)
 (setq IFRAME (getint "\nEnter An Integer:"))
 (cond ((= IFRAME 1)
        (command "_.IMAGEFRAME" "ON"))
       ((= IFRAME 0)
        (command "_.IMAGEFRAME" "OFF"))
       (T (princ "\nNo a Valid Integer")))
 (princ))

 

Not meaning to sounds critical - only helpful :thumbsup:

Link to comment
Share on other sites

Your known to be more precise Lee.

We have come to expect that.

And I would not expect less.

I just did that one fast off the top of my head.

But thats excellent.

 

What do you expect from a Buzzard with a bird brain.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...