您如何使用VBA绘制我的AutoCAD绘图?我试过
Sub PlotToPdf()
ThisDrawing.ActiveLayout.ConfigName = "DWF6 ePlot.pc3"
Dim plotFileName As String
plotFileName = "Z:\USERS\KweziM\PROJECT S\MyPlot.pdf"
Dim result As Boolean
result = ThisDrawing.Plot.PlotToFile(plotFileName)
End Sub
但这不起作用。
答案 0 :(得分:1)
最后一行应该是子程序调用,而不是函数调用......它应该看起来像这样
ThisDrawing.Plot.PlotToFile plotFileName
您不需要result
变量。
答案 1 :(得分:0)
试试这个:
Public Sub VBAplot()
Dim currentplot As AcadPlot
Set currentplot = ThisDrawing.Plot
ThisDrawing.ActiveLayout.ConfigName = "PDFCreator" ' Your plot device.
ThisDrawing.ActiveLayout.CanonicalMediaName = "A4"
ThisDrawing.ActiveLayout.StandardScale = acScaleToFit
ThisDrawing.Application.ZoomExtents
currentplot.PlotToDevice
End Sub