从VBA Begin Plot事件加载并运行LISP例程
您好,如果我正在使用begin plot事件,并且我想在begin plot上加载并运行lisp例程,这可能吗即:
[代码谢谢你,马克
绝对可能。 最好在Acad2中提前加载Lisp???文件。lsp具有以下内容:
(load "c:/Path/LispRoutine") 然后将其放置在;本图纸;dvb部分: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 <-----
ThisDrawing.SendCommand "(color2style)" & vbCr
End Sub
有了这个,它没有出错,但事件也没有运行,我可能需要在模型空间中循环,因为它查找变量drawingname可能是这样的
你觉得怎么样
谢谢你,马克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 当然,这不是#039;我没有真正回答你最初的问题,但它确实完成了工作(如果这是你需要做的)。 或者,为什么不将lisp转换为VBA
或者,搜索VLAX。CLS使在VBA中使用lisp变得相当容易
SendCommand的问题是A.)事件don';t喜欢命令调用,&;B、 )不会与VBA应用程序同步处理。
我喜欢学习,有时是;这很有趣
谢谢你,杰夫,
我刚才遇到过,但忘记了它的复杂性。
页:
[1]