Script to automatically IEMBED raster images

Script to automatically IEMBED raster images

anders_lk
Community Visitor Community Visitor
448 Views
2 Replies
Message 1 of 3

Script to automatically IEMBED raster images

anders_lk
Community Visitor
Community Visitor

Hi, I need to open hundreds of drawings containing xrefs to individual .tif images and use the Raster design command IEMBED to embed the image into each drawing file. I'd love to avoid doing this manually and I frequently use scripts to avoid scenarios like this, but AutoCAD returns 'UNKNOWN COMMAND' when I script with -IEMBED. I'm sure there is a way to get it working, but this one seems beyond me. Thanks for any advice.

0 Likes
449 Views
2 Replies
Replies (2)
Message 2 of 3

Sea-Haven
Mentor
Mentor

Problem number 1 color image

SeaHaven_0-1691647146921.png

The only way around seems to be to make a OLE object. This involves using say Paint to copy an image to the clipboard then you can paste to Cad. Some one using a .NET program may be able to open an image and make a clipboard copy of it. There appears to be some out there but that is as far as I went.

 

Ok a bit of a shortcut hopefully you follow this sequence. 

 

 

(alert "press ok once image is copied to clipboard")
(setq fname "D:\\Acadtemp\\Sand480x480.jpg") ; your image name read from dwg.
(startapp "MSPAINT" fname)
the image should open
Press Ctrl+A then Ctrl+C
Close paint
press OK in CAD
Type Ctrl+v it should ask for image location.

 

Yes next step is scale etc but that is easy part.

 

I tried connecting using get Application but that did not work not to say it won't work I may have been using wrong application name, then could control paint from CAD.

 

 

0 Likes
Message 3 of 3

paullimapa
Mentor
Mentor

There's a paid for app called JTB Raster2OLE for $50 that'll do this for you.

Also on the App Store.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes