70001359 Support CTB acad files

Article 70001359
Type Wish
Product Engine
Version 7015
Date Added 6/29/2018
Fixed 7.7016.0.1 (7/11/2018)
Submitted by Paul Woodcock

Summary

Support CTB acad plot style files

Solution

CBT files are printer definition files that the user can use in order to set different colors and lineweighs to entities that have indexed colors.
For example an entity that has color index 0 (red) the user can define to a ctb file that the index 0 will be yellow with 1 mm width. This color and width will be used when printing the file or export it in bitmap (using printer) , even in PDF export.

We exported a new property at the vdPrint object like below

summary>Returns an array of 255 items that overwrites the draw style properties of indexed color items.
public vdPrintStyleTable PrintStyleTable

The vdPrintStyleTable object has the following properties

summary>Returns the object, that this object is reference to.
public vdPrint Printer

summary>Returns a name for this object.Usually a ctb file that contains new printing pen style properties for color index entities
public string Name

summary> Returns the number of items in this object collection.Always 255 items.
public int Count

summary>Returns the at a specified index of the collection.
param name="index">The index of the object in range between 0 to - 1.
returns>The item at the spesific index.
public vdPrintStyle this[int index]

summary>Returns true if all of the items has true.
public bool IsEmpty

summary>Fill this object from an existing CTB file.
param name="name">A filename with .ctb extension.
returns>0 on success or a value greater than 0 for no success.
Search for the file in the following order:
remarks> 1. The path of the drawing's file.
remarks> 2. The installation path of the VectorDraw reference dlls.
remarks> 3. The path of the SetResourcesDirectory.
remarks> 4. The StartupPath of the Application
remarks> 5. The path for the executable file that started the application .
remarks> 6. The path of the SupportPath
public int Import(string name)

summary> Export this object to a ctb file defined by property, into the passed existing directory.
param name="DirectoryName">An existing directory on the disk.
returns>0 on success or a value greater than 0 for no success.
public int Export(string DirectoryName)

Sample code below will set 50 intensity to all indexed colors
for (int i = 0; i < 255; i++) doc.Model.Printer.PrintStyleTable[i].Intensity = 50;
doc.Model.Printer.PrintStyleTable.Export ("c:\\");

We also exported a new form that is showing this functionality and also has import/export and reset functionality for the user. This form can be seen in the printer dialog when selecting Pen Assigments.
 
Note: If the vdPrintStyleTable is not empty then the users might see slower printing for such files as the lists that VDF uses need to be re-calculated.

Send comments on this topic.