AutoCAD objects

Discussion in 'AutoCAD' started by Arka, Apr 16, 2004.

  1. Arka

    Arka Guest

    Is there a way of transferring AutoCAD object from VLisp/VBA application to
    VB application?
     
    Arka, Apr 16, 2004
    #1
  2. Arka

    cadtown Guest

    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
     
    cadtown, Apr 16, 2004
    #2
  3. Arka

    Arka Guest

    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, Apr 17, 2004
    #3
  4. Arka

    Danny P. Guest

    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
     
    Danny P., Apr 17, 2004
    #4
  5. 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.
     
    michael puckett, Apr 17, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.