muck Posted January 28, 2010 Posted January 28, 2010 AutoCAD VBA 2010. Is it possable to get the plot driver names and put them in a combo box or later programming plot uses. I am trying the following code but I am not having any luck. Private Sub CommandButton12_Click() Dim P As Object Dim p1 As Object Dim PL As String Dim x As Integer Set P = ThisDrawing.PlotConfigurations 'Set p1 = PL = P.ConfigName ComboBox1.Value = "Plotter Name" For Each PL In P.ConfigName 'ComboBox1.AddItem (P.Name) MsgBox P.Name Next End Sub I am also interested in getting available pin files in a combo box but I need to figure out how to do it with plotter names first. Thank you, Quote
dbroada Posted January 28, 2010 Posted January 28, 2010 I tried something like this... 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 Quote
Lee Mac Posted January 28, 2010 Posted January 28, 2010 I've never really programmed in VBA, but does this help? 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 Quote
muck Posted January 28, 2010 Author Posted January 28, 2010 Thanks the second group of code worked. I have not tryed the first yet. Can that code be modified to get pin setting files location??? Is there any information/tutorials on the AutoCAD plot objects so I can figure out this stuff myself. thank you, Quote
Lee Mac Posted January 29, 2010 Posted January 29, 2010 Thanks the second group of code worked. I have not tryed the first yet. Can that code be modified to get pin setting files location??? Is there any information/tutorials on the AutoCAD plot objects so I can figure out this stuff myself. thank you, There is quite a lot of information in the Visual LISP Editor help files :wink: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.