Posted on

Feature Table for Displaying Shapes in Subassembly Studio

Feature Table for Displaying Shapes in Subassembly Studio

We have recently released a new version of Subassembly Studio which contains an early version of a ‘Feature Table’. This new feature enables you to control the color of your subassembly shapes within Subassembly Studio based on the shape codes. For example, let’s say we have shapes coded ‘cut’ and ‘fill’, and would like these displayed in red and blue, respectively:

Cut and Fill shapes with colors determined from shape codes via a Feature Table

By default, Subassembly Studio will cycle through a fixed list of shape colors, with each shape assigned a color based on its draw order. If we had four shapes coded cut, fill, cut, and cut, we would see four different colors on the display. While this does let us know that the shapes formed correctly, it does not correlate in any way whatsoever with the shape codes. It would be far better to have all shapes coded cut drawn in the same color, and so forth.

To accomplish this, we create a Feature Table. First, enter the command \editftb at the Subassembly Studio command line (the backslash character is required). This will bring up the prototype version of the Feature Table Editor:

Feature Table Editor - editing a Feature Table in XML form

This is a simple text editor and does not contain any syntax validation, etc. It does, however, include a color selection tool (see below). It is intended as a temporary user interface and will be replaced with a more user friendly dialog in the future.

To add a code to the Feature Table, simply copy an existing line, create a new empty line, paste, and edit…

Codes may use an asterisk character as a wildcard – for example, if you wanted all codes beginning with ‘A’ to use a specific color, you could use the code ‘A*’, which would then match codes such as ‘ABC’, ‘A123’, etc.

Codes are searched in the order listed. The process for choosing which color to use is as follows:

Code matching algorithm

If no match is found, the ‘DefaultARGB’ value is used to draw the shape:

Cut, Fill, and Pave shapes with colors determined from codes using a Feature Table.

Colors are represented in text as ARGB hexadecimal values. The values begin with the ‘#’ symbol, which is followed by four 2-character values (no spaces) representing the Alpha, Red, Green and Blue channels. These values are hexadecimal values ranging from ‘00’ to ‘FF’. To edit a color, first highlight the entire color value (including the ‘#’ character, but NOT the quotes), and then click on the color wheel icon in the lower left corner of the window. This will bring up a color selection dialog:

Color Selection Dialog

If the selected text represents a valid color, the color will be pre-selected in the dialog; if not, a default value will be used instead.

In this dialog, you simply select the color you want to use by moving the white dot on the color wheel and adjusting the Luminance and Opacity sliders, or by using the ‘…’ button as shown above. Once the desired color is selected, click the OK button…the selected color will replace the highlighted text in the Feature Table. If no text was highlighted when you opened this dialog, the color value will be placed on the clipboard as plain text. If you cancel the selection, no changes will be made to the text, nor will anything be copied to the clipboard.

When editing the color value directly in the Feature Table XML, you can use a named color in place of the hex ARGB value – anything from the above list will be accepted (do not include the ‘#’ character for named colors). The value will be converted into ARGB when you commit your changes and will be shown in ARGB form the next time you edit the table.

We currently have plans to extend this new functionality to work with Points and Links as well, and to significantly improve the Feature Table Editor dialog.

 

The web store has been temporarily placed in demo/test mode while we update and test some new features. If you see this message and wish to make a purchase please contact sales@civilplus.net. Thank you.