Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Creating an OLE object without user interaction

Kyudos
Collaborator

Creating an OLE object without user interaction

Kyudos
Collaborator
Collaborator

Is there a LISP way to create an OLE object from a file using the file type (file association) without any user interaction? (in this case, an RTF using Word as the server, but it would be good if it was generic)

 

I realise I can just call PASTESPEC, but that then requires the user to make choices they might not understand....?

0 Likes
Reply
259 Views
5 Replies
Replies (5)

pendean
Community Legend
Community Legend

@Kyudos wrote:

...without any user interaction?...


Is the RTF (or other files) always called the same exact file name, same file type, and it is always in the same exact folder and folder hierarchy?

0 Likes

Kyudos
Collaborator
Collaborator

I'm actually trying to do this from my ARX, but there is no ObjectARX way as far as I can tell. That essentially means I know what the (RTF) file is called and where it lives, so I can  create the LISP anyway it needs to be done and/or I could use a fixed file name/location.

0 Likes

Moshe-A
Mentor
Mentor

@Kyudos hi,

 

You can also achieve the same result with PASTECLIP command and can be invoked from AutoLISP (command) function without the dialog box and if remember right in ObjectArx is the same with AcEdCommand.

 

Moshe

 

0 Likes

pbejse
Mentor
Mentor

Look into .NET 

System.Drawing.Image imge = Bitmap.FromFile(IMGTMP);
System.IO.MemoryStream mem = new System.IO.MemoryStream();
imge.Save(mem, System.Drawing.Imaging.ImageFormat.Jpeg);
imge.Dispose();
mem.Position = 0;
imge = System.Drawing.Image.FromStream(mem);
Clipboard.SetImage(ScaleImage(imge, 1600, 1200));

Where IMGTMP is the source image file

 

HTH

0 Likes

Kyudos
Collaborator
Collaborator

Thanks everyone for the input. I found that, despite what the docs appear to suggest, it is actually possible with ObjectARX:

 

https://forums.autodesk.com/t5/objectarx/ole-objectarx-my-misapprehension/td-p/13212964

0 Likes