TheSwamp
CAD Forums => CAD General => Topic started by: ELOQUINTET on March 02, 2004, 06:38:08 PM
-
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
-
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.
-
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....
-
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.
-
Here ya Dan.
(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)
)
-
Forgot the layer part!
(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)
(command "layer" "make" "0-IMAGE" "color" 7 "" "")
(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)
)
-
I have had a bit of time to peruse this...
This works as well...
(command "image" "a" "imagename" pause "7.9036" "-90")
If you need to browse for the image, use....
(command "image" "a" (getfiled "Image to insert" "" "jpg" 8) pause "7.9036" "-90")
-
I had tryed all way , changing attdia , ccmddia, and cmdactive, Iset it to 0
but it still show the dialog box.
If you use the command -image and set filedia to 0 the dialogue doesn't pop-up.
Ron :D
-
Hi Ronjop, I forget that the image was a file, and I did not consider the filedia as the variable to change. :oops:
Thanks for it :)
-
hey mark i was using what i asked for for jpgs at home but i am trying to adapt your lisp to tiff files here at work. i figured out that to change the file type to browse for i had to change the 8 to 14. it's working but my question is why would it be assigning an anonymous name "OAImg1082920496" to it rather than the actual name of the scan "a-430"? here's what i have:
(defun get-mspace ()
(vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))
)
(defun get-img-file ()
(getfiled "Browse for Image file: " "" "" 14)
)
(defun c:I12 (/ ms imgfile ins-pt image-obj)
(command "layer" "make" "0-IMAGE" "color" 7 "" "")
(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)
387.25
(* pi 1.50)
)
)
)
)
(if image-obj
(if (not (vlax-object-released-p image-obj))
(vlax-release-object image-obj)
)
)
(princ)
)
-
it's not a big deal i was just wondering if it's an easy fix or no?
-
Don't use 14 Dan.
-
ok changed it back to 8. for some reason when i had it as 8 before when i browsed it wasn't showing any tiffs so i thought this would fix that. now they are showing up with the 8, who knows? it's still giving the image a funky name and i can't see where it does that :?:
-
what is the exact name of the file you are trying to insert?
-
A-430 for this example. it varies though
-
A-430.?
-
is that your answer mark or were you guessing what i'd say?
-
Does the A-430 have an extension? Like .tif of .tiff
-
yeah .tif sorry bout that
-
HI,
Im having a problem extruding a non-circular shape around a helix. The shape I need to extrude is rectangular. Whenever I extrude a rectangle around a polyline helix (into solid form) the rectangle gets twisted. The rectangle starts off perpendicular to the axis of the helix and ends up twisted at an angle. I checked a number of furums and noticed other people had problems with helix's. Perhaps Autocad can't do this. If this is the case, is there a relatively easy way aound this. I'd like to point out that I'm not interested in extruding a circle. Id apreciate some feedback on this,
Thanks
:shock:
-
when posting a new post hit new thread not post a reply ok
-
Dan, did you ever get that little program to work for your .tif files? It works for me just fine!
-
johnjoe
Take a look Here (http://theswamp.org/phpBB2/viewtopic.php?t=1147)
-
ummm no mark its still giving it a dummmy name. i was mainly using it for something i'm doing at home so its not such a big deal. i have a huge video collection and am making inserts for my video cases. some i already have a volume and when i scan and insert it to use as a template for volume 2 i don't want to have to input the info. it would be nice because i considering zipping and burning them to disc. have you burned drawings with images to disc. is there a problem with it losing the path. i have everything in the same folder which i will burn. anyway that's the status report thanks for askin :P
-
I believe as long as you maintain the same path structure you'll be fine.