从VBA Begin Plot事件加载并运行LISP例程
**** Hidden Message ***** 这是绝对可能的。 最好在你的Acad2中提前加载Lisp???doc.lsp如下内容:(load "c:/Path/LispRoutine")
然后将其放在dvb的“ThisDrawing”部分:
Private Sub AcadDocument_BeginPlot(ByVal DrawingName As String)
ThisDrawing.SendCommand "(LispRoutine)" & vbCr
End Sub
好吧,就这么办(没测试过):
Private Sub AcadDocument_BeginPlot(ByVal DrawingName As String)
ThisDrawing.SendCommand "(load "c:/Path/LispRoutine")" & vbCr
ThisDrawing.SendCommand "(LispRoutine)" & vbCr
End Sub
这是一个很好的尝试
它仍然在第一行出错,所以我尝试了
Private Sub ACADApp_BeginPlot(ByVal DrawingName As String)
ThisDrawing.SendCommand Load("c:/custom/color2style") & vbCr Private Sub ACADApp_BeginPlot(ByVal DrawingName As String)
For each Drawingname in Thisdrawing.Modelspace
ThisDrawing.SendCommand Load("c:/custom/color2style") & vbCr <-----
ThisDrawing.SendCommand "(color2style)" & vbCr
Next Drawingname
End Sub
所以你想在绘图前加载CTB/PC3?如果是这种情况,为什么不使用quickplot类型的函数,一个包含所有打印参数的按钮/命令,例如:
ThisDrawing.SendCommand "-plot" & vbCr & "y" & vbCr & "Model" & vbCr
& "Oce TDS600 3.x.pc3" & vbCr & "ARCH expand D (36.00 x 24.00 Inches)" & vbCr
& "inches" & vbCr & "Landscape" & vbCr & "no" & vbCr & "extents" & vbCr & "fit"
& vbCr & "Center" & vbCr & "yes" & vbCr & "comed36x24.ctb" & vbCr & "yes" & vbCr
& "n" & vbCr & vbCr & vbCr & vbCr
这当然不能真正回答您最初的问题,但它确实完成了工作(如果您需要这样做的话)。 或者,为什么不将 lisp 转换为 VBA?
或者,搜索 VLAX。CLS使得在VBA中使用lisp变得相当容易。
SendCommand 的问题是 A。)事件不喜欢命令调用,以及 B。不与 VBA 应用程序同步处理。
我喜欢学习,有时很有趣。
谢谢Jeff,
我前阵子遇到了这个问题,但是忘记了它的复杂性。
页:
[1]