嘿,伙计们,已经到了。
我拿到了整个long VLAX类模块
我不太喜欢;仅仅给VBA传递一个糟糕的变量似乎就太多了。
将VLAX类模块插入到项目中后,您可以这样做:
- Sub VBAToLisp()
- Dim Obj As VLAX
- Dim strText As String
- Set Obj = New VLAX
- strText = "Hello!"
- Obj.SetLispSymbol "Test", strText
- Debug.Print strText
然后在ACAD,键入!测试
它应该返回Hello!
如果是这样,那么变量测试刚刚从VBA传递到ACAD或LISP,这是非常酷的
-
在另一方面;我正在尝试读入一个变量,但是目前为止还没有成功
下面是我所知道的:
- Dim Obj As VLAX
- Dim strText As String
- strText = "M" 'M was set to Mark in ACAD (setq M "Mark")
- Set Obj = New VLAX
- Obj.GetLispSymbol , strText
- Debug.Print strText
看看这个:
实际上,我更感兴趣的是让这种方法发挥作用,但仍然没有运气。
- Sub VBAToLisp()
- Dim VL As Object
- Dim strText As String
- Set VL = CreateObject("VL.Application.16")
- strText = "Hello!"
- VL.SetLispSymbol "Test", strText
- Debug.Print strText
- End Sub
我没有VL的方法。Application对象,所以我甚至不知道GetLispSymbol和SetLispSymbol方法在VLISP中是否可用。错误是说对象不支持这个方法,所以我想这就是我的答案。
有人吗?有什么想法吗?谢谢马克 |