.NET

Reply
Contributor
osayed3202
Posts: 12
Registered: ‎01-05-2014
Message 1 of 3 (196 Views)
Accepted Solution

load plot styles from server path

196 Views, 2 Replies
04-22-2014 06:05 PM

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

 

Best Regards
O.Sayed
CAD developer

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.

*Expert Elite*
norman.yuan
Posts: 998
Registered: ‎04-27-2009
Message 2 of 3 (141 Views)

Re: load plot styles from server path

04-24-2014 12:04 PM in reply to: osayed3202

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.

Contributor
osayed3202
Posts: 12
Registered: ‎01-05-2014
Message 3 of 3 (120 Views)

Re: load plot styles from server path

04-27-2014 11:42 AM in reply to: norman.yuan

thank you very much,

it works fine.

 

Best Regards
O.Sayed
CAD developer
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.