最佳的DCL代替方案,轻松实现VBA移植至Vlisp,动态创建、调用VBA窗体通用函数
Vlisp动态创建、调用VBA窗体通用函数:c:ysx-make-vbaform ,轻松实现VBA移植至Vlisp由于CAD的版本更新太夸张。ARX的编译版本太多,所以我一直用VB的DLL来实现。效果很好。不用频繁的更新软件了。
前辈,vb是指vb.net还是指vb6调用DLL用于64位CAD?如果vb6可实现,老师能否给个链接学习学习下,谢谢!
这是个好办法,但对于64位,好像要用到exe,不能用dll
格式:(c:ysx-make-vbaformVbaList)
VbaList--1(list {窗体(组件)列表} 2{窗体和组件属性列表} 3{预留} 4{自定义函数/事件代码列表} 5{API声明列表+Const常数列表+DIM/Private声明列表}
例子:
(defun c:yf()
(c:ysx-make-vbaform
(list (list "Form" "ChinaForm"
(list "Image" "Image1")
(list "CommandButton" "CommandButton1")
);窗体组件列表
(list (list "ChinaForm" "caption" "悬浮窗体" "width" 510 "height" 409)
(list "Image1" "left" 0 "top" 0 "width" 506 "height" 383 "AutoSize" 1)
(list "CommandButton1" "left" 260 "top" 250 "width" 75 "height" 20 "caption" "绘制直线")
) ;窗体和组件属性列表
nil
(list
(list "Private Sub CommandButton1_Click()" "ThisDrawing.SendCommand \"line \"" "End Sub")
(list "Private Sub UserForm_Activate()" "ChinaForm.Left = 0" "ChinaForm.top = 80" "End Sub")
(list "Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)"
"If ChinaForm.Left0 Then" "ChinaForm.Left = 0" "ChinaForm.Top = 80" "End If" "End Sub"
)
(list "Private Sub Image1_Click()" "If ChinaForm.Left =0 Then" "ChinaForm.Left = -507" "ChinaForm.top = 80" "End If" "End Sub")
)
)
)
(princ)
)
(defun c:yf()
(c:ysx-make-vbaform
(list (list "Form" "ChinaForm"
(list "Frame" "Frame1"
(list "TextBox" "text1")
(list "Frame" "Frame2"
(list "TextBox" "text3")
)
)
(list "TextBox" "text2")
);窗体组件列表
(list (list "ChinaForm" "caption" "悬浮窗体" "width" 110 "height" 200 "top" 110 "left" 1300)
(list "Frame1" "left" 4 "top" 4 "width" 98 "caption" "选项")
(list "text1" "width" 85 "left" 4 "top" 4 "text" "输入内容")
(list "Frame2" "width" 88 "height" 100 "left" 4 "top" 30 "caption" "中了")
(list "text3" "left" 4 "top" 5)
(list "text2" "left" 4 "top" 220)
) ;窗体和组件属性列表
nil
(list
(list "Private Sub text3_Change()" "text3.Text = Time$" "End Sub")
(list "Private Sub UserForm_Activate()" "ChinaForm.Left = 0" "ChinaForm.top = 60" "End Sub")
(list "Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)"
"If ChinaForm.Left0 Then" "ChinaForm.Left = 0" "ChinaForm.Top = 60" "End If" "End Sub"
)
(list "Private Sub UserForm_Click()" "If ChinaForm.Left =0 Then" "ChinaForm.Left = -106" "ChinaForm.top = 60" "End If" "End Sub")
)
)
)
(princ)
)
把dvb文件用Lisp以二进制文本方式储存
临时写出去转为dvb格式再倒入CAD
就可以实现把图片等信息都弄进Lisp里面!
nonsmall发表于2009-10-16 16:03:00
即时动态获取输入数据
页:
[1]
2