.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

load plot styles from server path

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
1147 Views, 2 Replies

load plot styles from server path

Hi Guys,

please I did batch plot using C# I use specific plot style name, but I want to load the plot styles in the storred path on the server into a ListBox.

 please see the image attached.

 

 

thank you very much

 

2 REPLIES 2
Message 2 of 3
norman.yuan
in reply to: Anonymous

You can use COM API AcadPreferencesFiles.PrinterStyleSheetPath to get the folder path where *.ctb files are located.

 

If you use .NET 4, you can use dynamic without having to add reference to AutoCAD COM API interop:

 

C# code would be like:

 

dynamic cadPreferences=Application.Preference;

string folder=cadPreferences.PrinterStyleSheetPath;

string[] ctbFiles=System.IO.Directory.GetFiles(folder, "*.ctb");

 

Then you can use the file name array to populate listbox.

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 3
Anonymous
in reply to: norman.yuan

thank you very much,

it works fine.

 

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost