.NET

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

load plot styles from server path

187 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
*Expert Elite*
norman.yuan
Posts: 984
Registered: ‎04-27-2009
Message 2 of 3 (132 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 (111 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
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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