View Full Version : Manipulating OLE Objects
zoomharis
2006-04-03, 02:38 PM
Hi all,
Is it possible to manipulate OLE objects embedded in AutoCAD programmatically....? For example, can i access the sheets of an excel document using AutoCAD VBA? I couldn't find anything helpful in AutoCAD Object Model. Please help....
har!s
RobertB
2006-04-05, 04:05 AM
Did you see the AcadOle object in the object browser? However, you can only perform AutoCAD-related functions on the OLE object, not sophisticated manipulations.
zoomharis
2006-04-05, 02:23 PM
Did you see the AcadOle object in the object browser? However, you can only perform AutoCAD-related functions on the OLE object, not sophisticated manipulations.
Thanks Robert, for the reply. But it looks very strange that as far as the file is outside AutoCAD you can have full control of it (Programmatically) and once it's inside, it's a pretty much limited stuff. IMHO it should have more power inside, as it is treated like an AutoCAD entity. I am looking for a way to communicate with an OLE object. I appreciate any suggestions.
har!s
RobertB
2006-04-05, 03:14 PM
There isn't, sorry. You can use APIs to modify the data in the source application, but there isn't much automation inside AutoCAD for OLE objects.
P.S. Take a close look at your signature line.
zoomharis
2006-04-05, 04:08 PM
P.S. Take a close look at your signature line.
Those are only meant for others. Not applicable to myself ;).
Thanks for the guidance.
8)
har!s
Ed Jobe
2006-04-05, 04:54 PM
The whole precept behind OLE is that the host application shouldn't have to manage the client's doc, other than to maintain a link to the file. So, naturally, you should expect native support to be on the thin side. About the best you could expect is to get the filename and then use the client's api to manipulate the file.
ntaylor
2006-04-05, 11:51 PM
>>About the best you could expect is to get the filename and then use the client's api to manipulate the file.
Correct. The ActiveX API does not expose the filename though. Or have I missed it?
Regards - Nathan
Ed Jobe
2006-04-06, 02:33 PM
Sorry, didn't mean to imply that it did. Just speaking about ole.
zoomharis
2006-04-06, 02:51 PM
The ActiveX API does not expose the filename though. Or have I missed it?
Yes Nathan, I was also looking for that . But I got nothing. Now i am looking for a way to access the OLE object(s) inside a drawing to know the type of file embedded over there ( for example Word document or Excel document etc.). So that I can try opening it with a related application ( The truth is that I don't even know how to go about it). The future seems to be very dark. Anybody have an idea.....?
:|
har!s
Ed Jobe
2006-04-06, 04:03 PM
The only thing I can think of without doing more research myself is, prompt the user. I gave up on ole a long time ago because its so limited. You could study it, but I didn't think it was worth my effort. Perhaps rethink your use of ole altogether, e.g. make your own com link to the other app and use acad objects to duplicate what you want. That's what programs that emulate xl do.
zoomharis
2006-04-06, 04:35 PM
T. I gave up on ole a long time ago because its so limited.
I am afraid that I have to do the same for the same reasons. ( Now - Long time ago = A long period) Nothing seems to have improved on this matter. It's a pure case of discrimination by AutoDesk towards OLE objects ;). I wish to see an AcadOLEs collection object and an AcadOLE object bundled together with the AutoCAD VBA Object Model with sophisticated features. Thanks Ed for your valuable suggestions.
har!s
Ed Jobe
2006-04-06, 08:03 PM
It's a pure case of discrimination by AutoDesk towards OLE objects ;). Is there an emoticon for tongue-in-cheek? If this is tongue out :-P then maybe...I can't find a backwards P on my keyboard.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.