Jump to content

Is it possable in to get plotter names in a combo box?


Recommended Posts

Posted

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,

Posted

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

Posted

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

Posted

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,

Posted
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:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...