Is there a way of transferring AutoCAD object from VLisp/VBA application to VB application?
Are you asking to convert your VBA codes to work in full VB environment or are you referring to the AutoCAD object Library ? You are basically accessing the same AutoCAD object Libray whether you use VBA,Vlisp or VB. Maybe you can clarify your question. http://www.cadtown.com
Command: (setq *acad-object* (vlax-get-Acad-Object)) #<VLA-OBJECT IAcadApplication 00a7b334> I need this (*acad-object*) object in my VB application to be referenced from the client (AutoCAD) application. The reason why I won't use VB GetObject(...blabla), because "GetObject" function takes the first running AutoCAD from the windows. In fact, a user can run multiple AutoCAD sessions and from other (#2nd & + etc.) sessions I won't be able to maintain my VB communication to that AutoCAD instance unless that is the #1 run AutoCAD. thanks,
Arka, I haven't been successful passing the application object from vlisp to VB as has been suggested. Perhaps I wasn't doing it correctly. The way I've approached this is to create a small dvb file which will pass ThisDrawing.Application to my VB application. Then from lisp, call the sub in the dvb to start the process. This will guarantee that the calling instance of AutoCAD will be sent to your vb app. Hope that helps, -Danny Polkinhorn WATG Honolulu
One way ... is to [re]write your application as an activex dll, providing a public method in a public creatable class that accepts an object as a parameter ( the AutoCAD Application Object ) and passes that to internal dependent logic. You may have to revisit your work flow so that the instantiation of your application is done from the client, which hands in the necessary object(s) and then says "Alright, go and show yourself". Hope that was clear enough. I've done this and it works quite well.