.NET

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

load plot styles from server path

225 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: 1,062
Registered: ‎04-27-2009
Message 2 of 3 (170 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 (149 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.