TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: deegeecees on June 07, 2004, 01:30:17 PM
-
Ok, I know this question has probably been asked, (and I did a search on this) is there a way to pass a variable from lisp to vba and vise versa?
-
Yes.
Search for the VLAX class code that allows the use of lisp in vba. Then set/read lisp variables in lisp & vba.
Jeff
-
I'm not too familiar with vlisp, could you give me an example of how that would work? Lets say I have this in VBA:
dim test1 as string
test1 = "test"
Now, how could I retrieve the value of test1 in lisp?
-
Here's an example using the vlax class.
Sub test()
Dim vlax As New vlax
Dim strText As String
strText = "Hello there!"
vlax.SetLispSymbol "test", strText
End Sub
Running the above will allow the symbol "test" to be used in a lisp function. Typing !test at the command line yields this:
Command: !test
"Hello there!"
HTH,
Jeff
-
Or, to retrieve a lisp symbol.....
(setq test 1234.5432)
Sub test2()
Dim vlax As New vlax
Dim strText
strText = vlax.GetLispSymbol("test")
Debug.Print strText
End Sub
-
Just what the doctor ordered! Thanks Jeff!
-
Glad I could help!