有可能得到普洛特吗
AutoCAD VBA 2010。是否可以获取绘图驱动程序名称并将其放入组合框或更高版本
编程绘图使用。
我正在尝试以下代码,但我没有任何运气。
私有子命令按钮12\u Click()
将P作为对象
将p1设置为对象
Dim PL作为字符串
尺寸x为整数
设置P=ThisDrawing。打印配置
'设置p1=
PL=P.ConfigName
ComboBox1.Value=“绘图仪名称”
对于P.ConfigName中的每个PL
'ComboBox1.AddItem(P.Name)
MsgBox P.Name
下一个
末端接头
我也有兴趣在一个组合框中获得可用的pin文件,但
我需要先弄清楚如何使用绘图仪名称。
非常感谢。 我试过这样的东西。。。
Dim i As Integer
Dim default As Integer
Dim PName As String
'DirList1.Drive = "H:"
'DirList1.Path = "\Design_Office"
'DirList1.Pattern = "*.dwg"
default = 0
For i = 1 To UBound(ThisDrawing.ModelSpace.Layout.GetPlotDeviceNames)
PName = ThisDrawing.ModelSpace.Layout.GetPlotDeviceNames(i)
cmbPrinters.AddItem PName
If PName = "PR03" Then default = i - 1
Next
cmbPrinters.ListIndex = default
For i = 0 To UBound(ThisDrawing.ModelSpace.Layout.GetPlotStyleTableNames)
cmbStyle.AddItem (ThisDrawing.ModelSpace.Layout.GetPlotStyleTableNames(i))
Next
cmbStyle.ListIndex = 0
End Sub
我从未真正用VBA编程,但这有帮助吗?
Sub GetPlotNames ()
Dim i As Integer
Dim Layout As ACADLayout
Set Layout = ThisDrawing.ModelSpace.Layout
Layout.RefreshPlotDeviceInfo
Dim plotDevices As Variant
plotDevices = Layout.GetPlotDeviceNames()
For i = LBound(plotDevices) To UBound(plotDevices)
MsgBox plotDevices(i)
Next
End Sub
感谢第二组代码的使用。我还没有试过第一个。
可以修改该代码以获取pin设置文件的位置吗???
是否有关于AutoCAD打印对象的任何信息/教程
这样我就能自己搞清楚这件事了。
非常感谢。
Visual LISP编辑器帮助文件中有很多信息:wink:
页:
[1]