Adding OLE Objects

Adding OLE Objects

Anonymous
Not applicable
354 Views
4 Replies
Message 1 of 5

Adding OLE Objects

Anonymous
Not applicable
Hi,
I have a .jpg inserted in an Excel workbook. I want to be able to copy this image, move over to autoCAD, and then paste it in my drawing. I don't know much about autoCAD, but I know that this would be adding an OLE object to a drawing. When looking through the reference libraries, I can't find a command to add an OLE object (I need it to paste from the clipboard I guess). If anyone can help with this problem it would be greatly appreciated!
Thanks.
0 Likes
355 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Adding an OLE Object would place an Excel Object in
the drawing where you only want the image

 

from help

 

Creates a new raster image based on an existing
image file.

 

Signature

 

RetVal = object.AddRaster(ImageFileName,
InsertionPoint, ScaleFactor, RotationAngle)

 

Object ModelSpace Collection, PaperSpace
Collection, Block
The object or objects this method applies
to.
ImageFileName String; input-only
The full path and file name of
the image.
InsertionPoint Variant (three-element array of doubles);
input-only
The 3D WCS coordinates in the drawing where the raster image will
be created.
ScaleFactor Double; input-only
The raster image scale
factor. The default image scale factor is 1. The scale factor must be a positive
number. You can set the scale of the image to the scale of the geometry created
in the AutoCAD drawing.

 

RotationAngle Double; input-only
The
rotation angle in radians for the raster image.
RetVal Raster
object
The newly created Raster object.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi,

I have a .jpg inserted in an Excel workbook. I want to be able to copy
this image, move over to autoCAD, and then paste it in my drawing. I don't
know much about autoCAD, but I know that this would be adding an OLE object to
a drawing. When looking through the reference libraries, I can't find a
command to add an OLE object (I need it to paste from the clipboard I guess).
If anyone can help with this problem it would be greatly appreciated!

Thanks.
0 Likes
Message 3 of 5

Anonymous
Not applicable
I used to use the method you just described for this project, but then I found out that the pictures I would be adding would be secure signed stamps and would have to be password-protected. Since you can't simply put a password on a .jpg file, I am inserting them in a protected Excel workbook and trying to copy them in like I explained above. If someone knows how to create an OLE object of the picture I want to copy, that would make my day and everything would be well in the world!
Thanks.
0 Likes
Message 4 of 5

mdemers
Enthusiast
Enthusiast
Someguy I think I know what you're asking, try first to have both Excel and Autocad open at the same time. Go to the Excel file , highlight the photo and right click your mouse and copy the picture. Go back to Autocad and under the pulldown EDIT select PASTE SPECIAL. Then select IMAGE ENTITY this should insert the photo into autocad. I hope this helps.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Yep, that's exactly what I want to accomplish - but I need Visual Basic to automate it for me. Does anyone know the code to do something like this?
0 Likes