Difference between revisions of "TechDraw NewAnnotation"

From FreeCAD Documentation
Jump to: navigation, search
m
m ((Vertical Docnav))
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
<languages/>
 
<translate>
 
<translate>
 +
<!--T:20-->
 +
{{Docnav
 +
|[[TechDraw_Redraw|Redraw]]
 +
|[[TechDraw_LeaderLine|LeaderLine]]
 +
|[[TechDraw_Module|TechDraw]]
 +
|IconL=TechDraw_Tree_Page_Sync.svg
 +
|IconC=Workbench_TechDraw.svg
 +
|IconR=Techdraw-mline.svg
 +
}}
 +
 
<!--T:1-->
 
<!--T:1-->
{{GuiCommand|Name=TechDraw  NewAnnotation|Workbenches=[[TechDraw Module|TechDraw]]|MenuLocation=TechDraw → Annotation|Shortcut=|SeeAlso=}}
+
{{GuiCommand
 +
|Name=TechDraw  NewAnnotation
 +
|MenuLocation=TechDraw → Annotation
 +
|Workbenches=[[TechDraw Module|TechDraw]]
 +
|SeeAlso=[[Draft Text|Draft Text]], [[Draft ShapeString|Draft ShapeString]]
 +
}}
  
 
==Description== <!--T:2-->
 
==Description== <!--T:2-->
 +
 +
<!--T:13-->
 
The Annotation tool adds a text block to a drawing page.
 
The Annotation tool adds a text block to a drawing page.
[[File:AnnotationSample.png|200px|center]]
+
 
 +
<!--T:14-->
 +
[[Image:AnnotationSample.png]]
 +
{{Caption|Annotation in the drawing page}}
  
 
==How to use== <!--T:3-->
 
==How to use== <!--T:3-->
 +
 +
<!--T:15-->
 
# If you have multiple drawing pages in your document, you will need to select the desired page in the tree.
 
# If you have multiple drawing pages in your document, you will need to select the desired page in the tree.
 
# Press the {{KEY|[[Image:TechDraw_NewAnnotation.png|24px]] [[TechDraw NewAnnotation|Annotation]]}} button
 
# Press the {{KEY|[[Image:TechDraw_NewAnnotation.png|24px]] [[TechDraw NewAnnotation|Annotation]]}} button
Line 13: Line 36:
 
# You may need to press recompute  [[Image:View-rotate-right.png|32px]] to get your text to change.
 
# You may need to press recompute  [[Image:View-rotate-right.png|32px]] to get your text to change.
  
 +
</translate>
 +
[[File:UpdateAnnotation.png]]
 +
<translate>
 
<!--T:8-->
 
<!--T:8-->
[[File:UpdateAnnotation.png|300px|center]]
+
{{Caption|Modifying the annotation through the property editor}}
 +
 
 +
<!--T:23-->
 +
<!-- Editor's and Traducer's note: do not change the &amp; values, they are used to escape the symbols and show them verbatim -->
  
==Options== <!--T:4-->
+
<!--T:24-->
None.
+
{{Emphasis|Note:}} some characters interfere with the internal representation of the Annotation text.  Specifically, these are the double quote {{incode|"}}, less than {{incode|<}}, and greater than {{incode|>}} symbols; these must be replaced by HTML escape characters, {{incode|&amp;quot;}}, {{incode|&amp;lt;}}, and {{incode|&amp;gt;}} respectively. See [https://en.wikipedia.org/wiki/Character_encodings_in_HTML#HTML_character_references Character encodings in HTML] for details.
  
 
==Properties== <!--T:5-->
 
==Properties== <!--T:5-->
ADD_PROPERTY_TYPE(Text ,("Default Text"),vgroup,App::Prop_None,"The text to be displayed");
+
 
ADD_PROPERTY_TYPE(Font ,(fontName.c_str()),vgroup,App::Prop_None, "The name of the font to use");
+
<!--T:12-->
ADD_PROPERTY_TYPE(TextColor,(0.0f,0.0f,0.0f),vgroup,App::Prop_None,"The color of the text");
+
The Annotation inherits all applicable basic View properties except {{PropertyData|Scale}}. Use the {{PropertyData|TextSize}} property instead.
ADD_PROPERTY_TYPE(TextSize,(8),vgroup,App::Prop_None,"The size of the text in mm");
 
ADD_PROPERTY_TYPE(MaxWidth,(-1.0),vgroup,App::Prop_None,"The maximum width of the Annotation block");
 
ADD_PROPERTY_TYPE(LineSpace,(80),vgroup,App::Prop_None,"Line spacing adjustment");
 
TextStyle.setEnums(TextStyleEnums);
 
ADD_PROPERTY(TextStyle, ((long)0));
 
  
 
<!--T:11-->
 
<!--T:11-->
Line 36: Line 60:
 
* {{PropertyData|MaxWidth}}: The maximum width of the Annotation block. -1 indicates no maximum width.  
 
* {{PropertyData|MaxWidth}}: The maximum width of the Annotation block. -1 indicates no maximum width.  
 
* {{PropertyData|LineSpace}}: Line spacing adjustment (%).
 
* {{PropertyData|LineSpace}}: Line spacing adjustment (%).
* {{PropertyData|TextStylee}}: "Normal", "Bold", "Italic", "Bold-Italic"
+
* {{PropertyData|TextStyle}}: "Normal", "Bold", "Italic", "Bold-Italic"
 +
 
 +
==Scripting== <!--T:6-->
 +
 
 +
<!--T:16-->
 +
{{Emphasis|See also:}} [[TechDraw API|TechDraw API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
  
<!--T:12-->
+
<!--T:17-->
Note: Annotation inherits all applicable basic View properties except Scale. Use the TextSize property instead.
+
The New Annotation tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following functions:
  
==Scripting== <!--T:6-->
 
Annotations can be added to Pages using Python.
 
 
</translate>
 
</translate>
 
{{Code|code=
 
{{Code|code=
Line 51: Line 78:
 
}}
 
}}
 
<translate>
 
<translate>
==Notes== <!--T:7-->
+
 
* None at this time
+
==Notes== <!--T:22-->
 +
 
 +
<!--T:21-->
 +
{{Docnav
 +
|[[TechDraw_Redraw|Redraw]]
 +
|[[TechDraw_LeaderLine|LeaderLine]]
 +
|[[TechDraw_Module|TechDraw]]
 +
|IconL=TechDraw_Tree_Page_Sync.svg
 +
|IconC=Workbench_TechDraw.svg
 +
|IconR=Techdraw-mline.svg
 +
}}
 +
 
 +
 
 +
<!--T:18-->
 +
{{TechDraw Tools navi}}
 +
 
 +
<!--T:19-->
 +
{{Userdocnavi}}
 
</translate>
 
</translate>
 
{{clear}}
 
{{clear}}
<languages/>
 

Latest revision as of 10:05, 16 October 2019

Other languages:
Deutsch • ‎English • ‎français • ‎italiano • ‎română • ‎русский
Arrow-left.svg Previous: TechDraw Tree Page Sync.svg Redraw
Next: LeaderLine Techdraw-mline.svg Arrow-right.svg

TechDraw NewAnnotation.png TechDraw NewAnnotation

Menu location
TechDraw → Annotation
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
Draft Text, Draft ShapeString


Description

The Annotation tool adds a text block to a drawing page.

AnnotationSample.png

Annotation in the drawing page


How to use

  1. If you have multiple drawing pages in your document, you will need to select the desired page in the tree.
  2. Press the TechDraw NewAnnotation.png Annotation button
  3. A text block containing "Default Text" will appear on the page. Use the property editor to change the text. Drag the Annotation to the required position.
  4. You may need to press recompute View-rotate-right.png to get your text to change.

UpdateAnnotation.png

Modifying the annotation through the property editor


Note: some characters interfere with the internal representation of the Annotation text. Specifically, these are the double quote ", less than <, and greater than > symbols; these must be replaced by HTML escape characters, &quot;, &lt;, and &gt; respectively. See Character encodings in HTML for details.

Properties

The Annotation inherits all applicable basic View properties except DATAScale. Use the DATATextSize property instead.

  • DATAText: The text to be displayed.
  • DATAFont: The name of the font to use. Annotation will use the best match of installed fonts.
  • DATATextColor: The color of the text.
  • DATATextSize: The size of the text in mm.
  • DATAMaxWidth: The maximum width of the Annotation block. -1 indicates no maximum width.
  • DATALineSpace: Line spacing adjustment (%).
  • DATATextStyle: "Normal", "Bold", "Italic", "Bold-Italic"

Scripting

See also: TechDraw API and FreeCAD Scripting Basics.

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

anno = FreeCAD.ActiveDocument.addObject('TechDraw::DrawViewAnnotation','TestAnno')
anno.Text = ['Different Text']
anno.TextStyle = 'Bold'
rc = page.addView(anno)

Notes

Arrow-left.svg Previous: TechDraw Tree Page Sync.svg Redraw
Next: LeaderLine Techdraw-mline.svg Arrow-right.svg