VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[VBA] list all CTB plotslyles

1 REPLY 1
Reply
Message 1 of 2
fredpox82
500 Views, 1 Reply

[VBA] list all CTB plotslyles

Hi there,

I'm developing a function to plot a drawing and I want to be able to select the plot style (CTB) to use.

In order to do so I want to populate a listbox in a userform with the list of all available plotstyles saved in the user pc.

How can I get the list of all plot styles?

thank you.

 

f

Tags (3)
1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: fredpox82

You use AcadPreferenceFiles.PrintStyleSheetPath to find folder location of CTB files, and then use DIR to get each *.CTB file name. Somethin glike:

 

Dim path As String

path=ThisDrawing.Applications.Preferences.Files.PrintStyleSheetPath

 

Dim ctbFiles() As String

Dim i As Interger

Dim ctb As String

 

ctb=Dir(path & "\*.ctb")

Do While ctb<>""

    Redim ctbFiles(i)

    ctbFiles(i)=ctb

    i=i+1

 

    ctb=Dir

 

Loop

 

''Now you can use the array of CTB file names to populate listbox/combox in the UserForm

 

 

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost