CAD Forums > CAD General

setting scale and rotation upon insert?

(1/5) > >>

ELOQUINTET:
i have this macro and i am trying to fix the scale and rotation. i want my image to be inserted with a scale of 7.9036 and with a rotation of -90. how would i modify my macro to acheive this?

(command "-layer" "n" "0-IMAGE" "c" "WHITE" "0-IMAGE" ) ;setvar clayer "0-IMAGE";_imageattach

DEVITG:
seem to be that _imageattach allways invoke the dialog box.

I do not know if there is a way to avoid the dialog box to show off.

Keith™:
You cannot use imageattach in this scenario you should use image....
Now to get the rest of the command parameters passed, you will need to..

1) Call image with a lisp function in your button... i.e. (command "image" ......)
2) Determine what the order of operation is for the image command. I don't use image (or imageattach for that matter) so right off the top of my head I cannot tell you.
3) Probably right after the attach command is issued,  you will need to specify insertion points and scales... you can use \ to pause (i think) and then hard code the scale...

Something like this ...

(command "image" "a") ;\ 90 7.9036

You will probably have to tweak it since I have not tested it....

DEVITG:
image invoke the dialog box too, a diferente but a dialog .

The trick would be how to tell acad not to show te dialog and acept command line input.

I had tryed all way , changing attdia , ccmddia, and cmdactive, Iset it to 0
but it still show the dialog box.

Mark:
Here ya Dan.

--- Code: ---
(defun get-mspace ()
 (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
 )

(defun get-img-file ()
  (getfiled "Browse for Image file: " "" "" 8)
  )

(defun c:img-insert (/ ms imgfile ins-pt image-obj)
  (setq ms (get-mspace)); modelspace object

  (if (setq imgfile (get-img-file))
    (if (setq ins-pt (getpoint "\nInsertion Point: "))
      (setq image-obj
             (vla-AddRaster ms
               imgfile
               (vlax-3D-point ins-pt)
               7.9036
               (* pi 1.50)
               )
            )
      )
    )
  (if image-obj
    (if (not (vlax-object-released-p image-obj))
      (vlax-release-object image-obj)
      )
    )
  (princ)
  )

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version