Digital Swatches are small thumbnails of finishes that can be placed and manipulated by the user.
How to Implement in Your Extension
DigitalSwatch is a
Snapper that contains a
Material and can be manipulated by the user. The idea is to be able to visualize the finish in the 2D view.
DigitalSwatch code resides in its own extension and package:
Add this line in your package file:
Add this line to your Extension Creation:
To spawn a DigitalSwatch use the following code:
Snapper s = DigitalSwatch(m); // m is the Material to be shown s.setPos(pos); // pos is the position you want the swatch to end up in Space coordinates. space.undoableInsert(s); // inserts the DigitalSwatch object into Space.
How the UI for the Digital Swatches are handled are up to each Extension Owner. This may include tying it to a finish legend or in some other way collect used finishes in the drawing to populate an area with Digital Swatches.