Snippets

Old Content - visit altium.com/documentation

Parent page: Client Panels

The Snippets panel is the central point for saving, reusing and managing Design Snippets.

Summary

The Snippets panel provides a simple and easy way to save and reuse sections of design circuitry or code. Saved Design Snippets can be added into any design, without you having to start from scratch each time. 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.

The Design Snippets feature, accessed though the Snippets panel, 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 – take a look at Altium Designer's support for Device Sheets.

Panel Access

Access the Snippets panel from the menu associated with the System panel-access button, located below the main design window. Alternatively, you can access the panel through the View » Workspace Panels » System sub-menu.

Snippet organization

The Snippets panel allows snippets are organized into folders, so that related snippets can be grouped together. There are two types of folders in the snippets system:

  • Snippets Folders – these are existing 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, outside of Altium Designer.
  • Sub-Folders – these are lower-level folders used to organize snippets in a more logical and structured way. They can be readily created (and deleted) from within the Snippets panel, or directly within and existing folder on your hard disk or network.

Adding and removing 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 (top-right of the Snippets panel) or by right-clicking within the panel and choosing Add » Snippets Folder.

Control which top-level folders of snippets are made available for use within Altium Designer.

Use the Open Folder button to browse to the required folder on your hard disk or network. The selected folder will be added to the list in the dialog, and subsequently appear within the Snippets panel.

To remove a top-level snippets folder from the list, which is essentially closing it from a browsing perspective, 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 the overall snippets structure, 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 by right-clicking on the folder in the Snippets panel and selecting the Properties command. To delete a sub-folder, right-click on its entry in the panel and choose Remove » Delete Folder.

The recommended way to add, move or remove sub-folders is from within the Snippets panel, so the the change is immediately reflected 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 store a snippet in the Snippets panel, select the required circuitry on the schematic or PCB editor, or code within a code-aware editor, then right-click and choose Snippets » Create Snippet from selected objects command from the context menu. A snippet can also be created from within the Snippets panel. With the objects/code selected in the editor, right click in the Snippets panel and choose the Create Snippet from Selection command.

Example of creating a snippet from a schematic circuit fragment.

The Add New Snippet dialog opens. 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.

Define properties of the new snippet as required.

Once saved, the snippet will be created and subsequently presented in the Snippets panel. Note that 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 indexing file is also present for each snippet folder, to keep track of the snippets it contains.

Placing Snippets

To place a snippet in a design, select its entry in the Snippets panel and click the corresponding Place xxx button at the top of the panel. Alternatively, right-click on the entry for the snippet and choose Place Snippet from the context menu.

Place a reusable fragment of circuit or code into your design from the Snippets panel.

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 - that is, the snippet type and document type must be the same.

Deleting Snippets

To delete a snippet, 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

Right-Click Menus

Right clicking in the Snippets panel will offer the following options and commands:

  • Place Snippet (available when a snippet is selected) - Place the currently selected snippet in the design workspace.
  • Delete Snippet (available when a snippet is selected) - Delete the currently selected snippet.
  • Add - Create a new folder under the parent folder, or add an existing Snippets folder to those available in the panel.
  • Remove - Clear the contents of a folder, or delete the folder itself.
  • Sort - Sort the panel's folder/snippet listing by date/type/name and set the folder/details visibility.
  • Show Thumbnails - Select Snippets to be displayed in thumbnail or icon form. In the icon state, a snippet's comment is not displayed in the panel.
  • Properties - Opens the Snippet Properties dialog to view or edit the properties of the selected snippet.

You are reporting an issue with the following selected text and/or image within the active document: