Stacey Nicole
stacey...@towill.com
I have a solution for this, but probably may not be usefull at all times.
If you would like transfer values like strings or numbers from VBA to VLISP,
then probably u can assign them to one of the user variables
(setvariables)[Ex: Users1-5 or Userr1-5 or Useri1-5] and then from VLISP
access these setvariables.
Similarly, from VLISP to VBA.
Note, that this has a lot of limitations.
Thilak
thil...@hotmail.com
You could pass data as string through a file. Works like a charm. I have been doing so since AC
r2.3 when PDS was Basic. <g>
Cheers,
Lu
;-----------------------------------------------------------------------
; When all else fails, read the book. But there ain't none no more! <g>
; CAD-Tek web site: http://www.cad-tek.com
;-----------------------------------------------------------------------
Certainly not bullet / idiot proof, but it'll work.
e.g.
''' VB(A) *******************************
Dim VarName as String
Dim VarData as Variant
VarName = "USERR1"
' get data left by last program to access UserR1
VarData = ThisDrawing.GetVariable (VarName)
' do stuff, change value, send it back to user var
VarData = 2 * PI
ThisDrawing.SetVariable VarName, VarData
;;; LISP *******************************
; get data left by last program accessing UserR1
(setq vardata (getvar "userr1"))
; do stuff, change value, send it back to user var
(setvar "userr1" (* 2 pi))
Precarious stuff, since any, and all programs have access to this "landing
zone", but it is really easy to use (and abuse). If your VB(A) and LISP
programs are running back to back it shouldn't pose a problem.
- - -
In the good old DOS days I use to use upper memory (beyond 640k) unused by
video to swap data between programs; sure miss those days.
Regards,
M.
- - -
Luther W. Early <lea...@cad-tek.com> wrote in message
news:370e5ee1....@adesknews.autodesk.com...
> On Thu, 08 Apr 1999 10:42:54 -0700, Stacey Yates <stacey...@towill.com>
wrote:
>
> >Does anyone know the command or sequence of commands to transfer
> >a variable (from a textbox control in VBA: variable.text) into a Visual
> >Lisp
> >variable? and ViceVersa if possible...any recommendations would be
> >very very helpful...thanx.
> >
> >Stacey Nicole
> >stacey...@towill.com
> >
<snip>
(Before you can do this, you must first call
(vl-load-com) in Visual LISP)
Public Sub1()
Dim VLisp as Object
Dim vlEval as Object
Dim vlRead as Object
Dim vlResult as Object
App As AcadApplication
Set App = ThisDrawing.Application
Set Vlisp = App.GetInterfaceObject("VL.Application.1")
Set vlEval = VLisp.ActiveDocument.Functions.Item("Eval")
Set VlRead = VLisp.ActiveDocument.Functions.Item("read")
Set VlResult = VlRead.FunCall("(setq x 99)")
Set vlResult = VlEval.FunCall(vlResult)
End Sub
Stacey Yates wrote:
>
> Does anyone know the command or sequence of commands to transfer
> a variable (from a textbox control in VBA: variable.text) into a Visual Lisp
> variable? and ViceVersa if possible...any recommendations would be
> very very helpful...thanx.
>
> Stacey Nicole
> stacey...@towill.com
>
--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.t...@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
change 'App As AcadApplication' to
'Dim App As AcadApplication'
Here is code with small modification. I have tried the code given by Tony.
For lists and other data types also. I can use standard data types in VB and
AutoLisp. There is no similar data type like list in AutoLisp in VB(A)
Sub Sub1()
Dim VLisp As Object
Dim vlEval As Object
Dim vlRead As Object
Dim vlResult As Variant
Set VLisp = ThisDrawing.Application.GetInterfaceObject("VL.Application.1")
Set vlEval = VLisp.ActiveDocument.Functions.Item("Eval")
Set vlRead = VLisp.ActiveDocument.Functions.Item("read")
Set vlResult = vlRead.FunCall("(setq x (list 100 100))")
If TypeName(vlEval.FunCall(vlResult)) = "DVlObject" Then
Set vlResult = vlEval.FunCall(vlResult)
Else
vlResult = vlEval.FunCall(vlResult)
End If
Set vlResult = vlRead.FunCall("(setq y 100)")
If TypeName(vlEval.FunCall(vlResult)) = "DVlObject" Then
Set vlResult = vlEval.FunCall(vlResult)
Else
vlResult = vlEval.FunCall(vlResult)
End If
End Sub
Kailas Dhage
Tony Tanzillo wrote in message <370F23B4...@worldnet.att.net>...