Vlax for VB6

Discussion in 'AutoCAD' started by Sinisa Knezevic, Feb 11, 2004.

  1. Hi to all,

    did anyone modify vlax.cls to use in VB6? I tried but I had problems with
    loading VL.Application.1....

    Tnx

    Sinisa
     
    Sinisa Knezevic, Feb 11, 2004
    #1
  2. If you're using AutoCAD 2004, change that VL.Application.16.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Feb 11, 2004
    #2
  3. No, I am using A2k and A2k2
     
    Sinisa Knezevic, Feb 11, 2004
    #3
  4. You must call (VL-LOAD-COM) prior to instantiating a VLAX object.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Feb 11, 2004
    #4
  5. Yes, I did it, but it still doesn't work.

    I try to develope a standard exe project, with Module:

    Sub main()
    Dim oVLAX As VLAX
    Dim retVal As Variant

    Set oVLAX = New VLAX

    retVal = oVLAX.GetLispSymbol("myGlobalVar")
    Debug.Print retVal
    oVLAX.NullifySymbol "myGlobalVar"
    End Sub

    annd using modified vlax.cls (first lines of class writen):

    Private VL As Object
    Private VLF As Object
    Private acdApp As Object
    Private Sub Class_Initialize()


    Set acdApp = CreateObject("AutoCAD.Application")
    Set VL = acdApp.GetInterfaceObject("VL.Application.1") 'here occured a
    problem
    Set VLF = VL.ActiveDocument.Functions

    End Sub

    Message is: Problem in loading application
    !!??
     
    Sinisa Knezevic, Feb 12, 2004
    #5
  6. VLAX works fine so the problem is in your approach. Based upon your code
    here, where exactly are you issuing the (VL-LOAD-COM)? Also, how many
    versions of AutoCAD do you have installed? By setting acdApp to
    "AutoCAD.Application", you are getting whatever the last run version is.
    You need to be more specific whenever you write code so you eliminate as
    many wildcards as possible!

    Try these steps EXACTLY:

    1. Open AutoCAD 2002
    2. Type in (VL-LOAD-COM) and then ENTER so *you know* its loaded
    3. Change the following line:
    from:
    to:
    Set acdApp = GetObject(, "AutoCAD.Application.15")
    4. Now try and see if you connect to VLAX

    If this doesn't work, post back your code and I'll look at it for you.
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Feb 12, 2004
    #6
  7. In AutoCAD Text Window:

    ((vl-load-com)
    (setq myGlobalVar "myGlobalData"))
    Just one, ACAD2000.
    No, unfortunately doesn't work.

    I did it yet in previous post to Frank but here it is again with
    modification you suggested:

    Private VL As Object
    Private VLF As Object
    Private acdApp As Object
    Private Sub Class_Initialize()
    Set acdApp = GetObject(, "AutoCAD.Application.15")
    Set VL = acdApp.GetInterfaceObject("VL.Application.1")
    Set VLF = VL.ActiveDocument.Functions

    End Sub

    This is first Sub of vlax, the rest of vlax has no changes.

    This Class I use in:

    Sub main()
    Dim oVLAX As VLAX
    Dim retVal As Variant

    Set oVLAX = New VLAX

    retVal = oVLAX.GetLispSymbol("myGlobalVar")
    Debug.Print retVal
    oVLAX.NullifySymbol "myGlobalVar"
    End Sub
     
    Sinisa Knezevic, Feb 12, 2004
    #7
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.