drawsvg iconDraw-SVG user's guide
PreviousNextContentsPDFdrawsvg home

6.4. Symbol management

Abstract

A symbol is a complete drawing that is embedded in the document definitions and displayed by a use element.

This chapter describes the management of symbols (creation, import, refactoring,...).

How to create a symbol

To create a symbol:

  • Draw its elements

  • Select them

  • Go to the Selection menu and definitions section

  • Click the define symbol icon Image task-sel-def-symbol.svg to create the symbol and open the symbol dialog panel on it

    The symbol is defined with the selected elements

    The parameters are calculated by default

    Image symbol-definition.png
  • Enter the symbol ID then click OK to create the symbol

See creating symbols showcase for an online demonstration.

Note

The symbol dialog can be launched from the Document menu and definitions section from it's icon Image task-doc-sym.svg to edit all symbol definitions in the document.

How to import symbol

This section describes how to create a symbol by importing its SVG file.

  • Go to the document menu and definitions section

  • Click the import symbol icon Image task-doc-importsym.svg

  • Load the SVG document of the symbol (the document must no contains defs elements)

  • The symbol is created with default parameters

    Set the ID of the symbol in the symbol panel

  • To draw the symbol, go to the Shapes menu and click the symbol catalog icon Image task-symbolCatalogBtn.svg

    Then click top left and bottom right corners of the symbol

How to refactor symbol

Refactor use element as group to update symbol content and create new one.

To refactor a symbol:

  • Draw the symbol

  • Copy the use element to refactor it

  • Go to the Selection menu and refactor section

  • Click the Refactor to group icon Image task-sel-refactor-use-g.svg

    The use element is replaced by a group with the symbol contents

  • Make all changes needed for the new symbol

    Add/remove elements to the group,change geometries, edit style properties,..

  • Select elements and create the new symbol

See refactor symbols showcase for an online demonstration.

How to change the symbol displayed by a use element

To draw another symbol:

  • Select the use element

  • Click on the choose symbol icon in the floating menu :

    Image use-change-symbol.png
  • Select the symbol to display from the chooser:

    Image symbol-chooser.png