Visual LISP, AutoLISP and General Customization
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Script to automatically IEMBED raster images

Message 1 of 3
135 Views, 2 Replies

Script to automatically IEMBED raster images

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.

Message 2 of 3
in reply to: anders_lk

Problem number 1 color image


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.



Message 3 of 3
in reply to: anders_lk

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators

Autodesk Design & Make Report