TechDraw Symbol: Difference between revisions

From FreeCAD Documentation
(properties added)
mNo edit summary
Line 58: Line 58:


<!--T:26-->
<!--T:26-->
A Symbol object is derived from a ??? object and inherits all its properties (See [[TechDraw_View#Properties|TechDraw View]] for properties that are common to all View types). It also has the following additional properties:
A Symbol object has the [[TechDraw_View#Properties|properties]] that are common to all View types. It also has the following additional properties:


=== Data ===
=== Data ===

Revision as of 13:12, 4 July 2024

TechDraw Symbol

Menu location
TechDraw → TechDraw Views → Insert SVG Symbol
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw Templates, Draft SVG

Description

The TechDraw Symbol tool inserts a Symbol object into the current page. A Symbol is a stripped down view that contains only a single SVG file complying with the svg-tiny specification (see TechDraw Templates).

A Symbol can be anything that helps annotating a drawing and that doesn't need to be further modified, however it may also contain editable texts.

Compass rose added to the drawing page; this symbol is available by installing the "symbols_library" addon with the Addon Manager

Usage

  1. If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the Tree view.
  2. There are several ways to invoke the tool:
    • Press the Insert SVG Symbol button.
    • Select the TechDraw → TechDraw Views → Insert SVG Symbol option from the menu.
  3. If there are multiple drawing pages in the document and you have not yet activated a page, the Page Chooser dialog box opens: introduced in version 0.20
    1. Select the desired page.
    2. Press the OK button.
  4. A file dialog opens.
  5. Select a location and file name.
  6. The symbol is inserted.
  7. Optionally change its DataScale property to adjust its size.

Notes

  • DataScale Type for Symbols is always set to Custom at creation. This is for convenience, since symbols are almost always scaled differently from the rest of the objects on the page.

Properties

See also: Property editor.

A Symbol object has the properties that are common to all View types. It also has the following additional properties:

Data

Drawing view

  • Data (Hidden)Symbol (String): The SVG code defining this symbol.
  • DataEditable Texts (StringList): List of editable texts, if any.
  • DataOwner (Link): Feature to which the symbol is attached.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

The Symbol tool can be used in macros and from the Python console by using the following functions:

sym = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewSymbol','TestSymbol')
rc = page.addView(anno)
f = open(unicode(symbolFileSpec,'utf-8'),'r')
svg = f.read()
f.close()
sym.Symbol = svg
rc = page.addView(sym)