Results 1 to 3 of 3

Thread: Map VBA's VLAX ?

  1. #1
    100 Club KevinBarnett's Avatar
    Join Date
    2001-10
    Location
    Pretoria, South Africa
    Posts
    119
    Login to Give a bone
    0

    Question Map VBA's VLAX ?

    Greetings,

    I am trying to issue ade functions within VBA (Map 2005) using Frank's VLAX:

    retval = obj.EvalLispExpression("(ade_projsetsrc " & _
    Chr(34) & ComboBox1.value & Chr(34) & ")")

    retval = obj.EvalLispExpression("(ade_projsetdest " & _
    Chr(34) & ComboBox2.value & Chr(34) & ")")

    retval = obj.EvalLispExpression("(ade_projptforward " & _
    "(list " & Trim(TextBox1.Text) & " " & Trim(TextBox2.Text) & "))")

    But it does not appear to respond.

    I have a feeling that this line in the class:
    Set VL = ThisDrawing.Application.GetInterfaceObject("VL.Application.16")
    is only loading the base lisp and not the ade's.

    Does anybody know the solution?

    Thanks,

    Kevin.
    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,867
    Login to Give a bone
    0

    Default Re: Map VBA's VLAX ?

    ade is not lisp. they are commands loaded from an arx. Try the (command) function, since you are using vlax. Otherwise use SendCommand.
    C:> ED WORKING....

  3. #3
    100 Club KevinBarnett's Avatar
    Join Date
    2001-10
    Location
    Pretoria, South Africa
    Posts
    119
    Login to Give a bone
    0

    Default Re: Map VBA's VLAX ?

    Thanks. The follwoing worked, but could I have completed the task in less steps?

    Sub try()
    ThisDrawing.SendCommand "(ade_projsetsrc " & _
    Chr(34) & "Lo-27-WGS" & Chr(34) & ")" & vbCr

    ThisDrawing.SendCommand "(ade_projsetdest " & _
    Chr(34) & "LL" & Chr(34) & ")" & vbCr

    ThisDrawing.SendCommand "(setq a (ade_projptforward " & _
    "(list 99229.367 2820428.461)))" & vbCr

    ThisDrawing.SendCommand "(setvar " & Chr(34) & "userr1" & Chr(34) & _
    " (car a))" & vbCr

    ThisDrawing.SendCommand "(setvar " & Chr(34) & "userr2" & Chr(34) & _
    " (cadr a))" & vbCr

    Dim X, Y As Double

    X = ThisDrawing.GetVariable("userr1")
    Y = ThisDrawing.GetVariable("userr2")
    MsgBox CStr(X) & "," & CStr(Y)
    End Sub
    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

Similar Threads

  1. vlax-put-property
    By jkleinowski in forum AutoLISP
    Replies: 1
    Last Post: 2011-01-21, 04:47 AM
  2. vlax-curve and UCS
    By irneb in forum AutoLISP
    Replies: 4
    Last Post: 2010-01-25, 01:02 PM
  3. Map VBA's VLAX ?
    By KevinBarnett in forum AutoCAD Map 3D - General
    Replies: 0
    Last Post: 2005-01-27, 09:00 AM
  4. vlax-invoke
    By mahazen in forum AutoLISP
    Replies: 2
    Last Post: 2004-08-07, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •