Design Snippets
Contents
If your designs often include common 'sections' of circuitry or code, then you will make good use of the Design Snippets feature. A simple and easy to use feature, the Snippets system lets you save any selection of:
- Circuitry on a single schematic sheet
- Circuitry in a PCB design, including the components and the routing
- Code from within one of Altium Designer's code-aware editors.
A circuit 'snippet' can be added into any design, without you having to start from scratch each time – design reuse, made simple.
The Design Snippets feature is great for those often-used fragments and smaller sections of circuitry that you want to reuse. For larger, more standalone circuits that you wish to reuse in multiple designs – for example power regulation circuits, USB interface circuitry, and so on – check out Altium Designer's support for Device Sheets.
Accessing Snippets
Access to snippets is made through the Snippets panel. Access this panel from the menu associated with the System panel-access button, located below the main design window.
Panel Display
Snippets can be displayed in either thumbnail or icon form by toggling the Show Thumbnails command on the panel's right-click menu. With the latter, only the icon and snippet name will be displayed in the panel – any comment defined for the snippet will not be displayed.
Snippet Organization
Snippets are organized into folders, enabling you to logically group related snippets together. There are two types of folders in the snippets system:
- Snippets Folders – these are standard Windows folders that can contain both snippets and one or more sub-folders of snippets. These top-level folders cannot be created from within the Snippets panel. Rather they are 'opened' or 'closed' with respect to browsing the snippets they contain. These folders can only be created directly on your hard disk (or network locale), outside of Altium Designer.
- Sub-Folders – these are lower-level folders used to organize snippets in a far more logical and structured way. They can be readily created (and deleted) from within the Snippets panel, or directly on your hard disk or network locale (outside of Altium Designer).
By default, a number of example snippets are included in the \Examples\Snippets Examples
folder of the installation.
Opening Snippets Folders
Top-level snippets folders are opened and closed from the Available Snippets Folders dialog. Access this dialog by clicking the Snippets Folders button – at the top-right of the Snippets panel – or by right-clicking within the panel and choosing Add»Snippets Folder.
Simply click the Open Folder button, then browse to the required folder on your hard disk or network locale. The folder will be added to the list in the dialog, and subsequently appear within the Snippets panel upon closing the dialog.
Should you wish to remove a top-level snippets folder from the list – essentially closing it from a browsing perspective – simply select that folder in the list and click the Remove Folder button. Alternatively, right-click on the folder in the Snippets panel and choose Remove»Close Snippets Folder.
Use the Move Up and Move Down buttons to change the order in which the top-level folders will be presented in the Snippets panel.
Adding and Removing Sub-Folders
To add a new sub-folder to your overall snippets structure, simply right-click within the Snippets panel and choose the Add»Create New Folder command. The Folder Properties dialog will appear, from where you can specify a name for the new folder and determine under which parent folder it is to be created.
A sub-folder can be renamed and moved under a different 'parent' folder at any time. Simply right-click on the folder in the Snippets panel and choose the Properties command.
To delete a sub-folder, simply right-click on its entry in the panel and choose Remove»Delete Folder.
It is advised that you add, move or remove sub-folders from within the Snippets panel, in order to see the change reflected instantly in the panel. If you add, move or delete folders directly using Windows, the update will not be reflected in the panel until you close and restart Altium Designer.
Creating Snippets
To create a snippet, simply select the required circuitry on the schematic or PCB, or code within a code-aware editor, then right-click and choose the Create Snippet from selected objects command from the context menu that appears.
A snippet can also be created from within the Snippets panel. With the objects/code selected, simply choose the Create Snippet From Selection command, at the top of the panel's right-click menu.
The Add New Snippet dialog will appear. Use this dialog to define a name for the snippet, in which folder it should be stored, as well as any descriptive comment which describes the circuit or code fragment.
Upon clicking OK, the snippet will be created and subsequently presented in the Snippets panel.
The name, folder location and comment for a snippet can be changed at any time from the Snippet Properties dialog – accessed by right-clicking on the snippet entry in the panel and choosing Properties from the context menu.
Each snippet is stored in a standard schematic, PCB or code-based (e.g. *.vhd
) file. Upon creation, several other files are also created (*.Snippet
, *.SnippetIcon
, *.SnippetThumbnail
). An idexing file is also present for each snippet folder, to keep track of the snippets contained therein.
Placing Snippets
To place a snippet into your design, simply select its entry in the Snippets panel and click the corresponding Place button at the top of the panel. Alternatively, right-click on the entry for the snippet and choose Place Snippet from the context menu.
Ensure you have the correct target document open as the active document before placing the snippet. The place command/button will only be available if the snippet can validly be placed on that document (i.e. snippet type and document type must be the same).
Deleting Snippets
To delete a snippet, simply right-click on its entry in the Snippets panel and choose the Delete Snippet command.
To delete all snippets in a particular folder, right-click on that folder and choose the Remove»Clear Folder command.