TechDraw RichTextAnnotation: Difference between revisions

From FreeCAD Documentation
No edit summary
(Usage)
 
(25 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:16-->
<!--T:16-->
{{Docnav
{{Docnav|[[TechDraw_LeaderLine|LeaderLine]]|[[TechDraw_CosmeticVertex|Cosmetic Vertex]]|[[TechDraw_Module|TechDraw]]|IconL=Techdraw-mline.svg|IconC=Workbench_TechDraw.svg|IconR=Techdraw-point.svg}}
|[[TechDraw_LeaderLine|LeaderLine]]
|[[TechDraw_CosmeticVertex|CosmeticVertex]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_LeaderLine.svg
|IconR=TechDraw_CosmeticVertex.svg
|IconC=Workbench_TechDraw.svg
}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=TechDraw RichTextBlock
|Name=TechDraw RichTextAnnotation
|MenuLocation=TechDraw → Annotations → Insert Rich Text Annotations
|Icon=techdraw-textleader.svg
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|MenuLocation=TechDraw → RichTextBlock
|Version=0.19
|Workbenches=[[TechDraw Module|TechDraw]]
|SeeAlso=[[TechDraw Templates|TechDraw Templates]], [[Draft SVG|Draft SVG]], [[TechDraw_LeaderLine|LeaderLine]]
|SeeAlso=[[TechDraw_Annotation|TechDraw Annotation]]
}}
}}


Line 16: Line 24:


<!--T:8-->
<!--T:8-->
The RichTextBlock tool adds a formatted annotation block to a [[TechDraw_LeaderLine|LeaderLine]] or a View.
The '''TechDraw RichTextAnnotation''' tool adds a formatted annotation block to a [[TechDraw_LeaderLine|Leaderline]] or a View.


</translate>
</translate>
[[Image:TechDraw_RichTextBlock_sample.png]]
[[Image:TechDraw_RichTextBlock_sample.png|220px]]
<translate>
<translate>
<!--T:9-->
<!--T:9-->
{{Caption|Stand alone RichTextBlock}}
{{Caption|Stand alone RichTextAnnotation}}


==How to use== <!--T:3-->
==Usage== <!--T:3-->


<!--T:10-->
<!--T:10-->
# If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the [[Tree_view|Tree view]].
# Press the {{Button|[[Image:techdraw-textleader.svg|16px]] [[TechDraw RichTextBlock|RichTextBlock]]}} button
# To attach the RichTextAnnotation to a [[TechDraw_LeaderLine|Leaderline]], select the line in the [[Tree_view|Tree view]] or on the page.
# A Task dialog will open. The dialog allows quick entry of text.
# There are several ways to invoke the tool:
# The Start Rich Text Editor button will open a full featured editor. Press the Save icon to record your changes.
#* Press the {{Button|[[Image:TechDraw_RichTextAnnotation.svg|16px]] [[TechDraw_RichTextAnnotation|Insert Rich Text Annotation]]}} button.
# After the block is created, it can be edited by double clicking the RichTextBlock in the Tree.
#* Select the {{MenuCommand|TechDraw → Annotations → [[Image:TechDraw_RichTextAnnotation.svg|16px]] Insert Rich Text Annotation}} option from the menu.
# To attach the block to a [[TechDraw_LeaderLine|LeaderLine]], select the line before starting the RichTextBlock tool.
# If there are multiple drawing pages in the document and you have not yet activated a page, the {{MenuCommand|Page Chooser}} dialog box opens: {{Version|0.20}}
## Select the desired page.
## Press the {{Button|OK}} button.
# A task panel opens.
# The task panel allows quick entry of text.
# The {{Button|Start Rich Text Editor}} button opens a full featured editor:
## When done, press the {{Button|[[Image:Document-save.svg|16px]]}} button to save your changes and close the editor.
# Press the {{Button|OK}} button to close the task panel.


==Notes== <!--T:18-->

<!--T:21-->
* After creation a RichTextAnnotation can be edited by double clicking it on the page.


==Properties== <!--T:19-->
==Properties== <!--T:19-->


<!--T:20-->
<!--T:20-->
* {{PropertyData|X,Y}}: The location of the block. Relative to the end of the line if attached to a [[TechDraw_LeaderLine|LeaderLine]], otherwise this is the position on the page.
* {{PropertyData|X,Y}}: The location of the block. Relative to the end of the line if attached to a [[TechDraw_LeaderLine|Leaderline]], otherwise this is the position on the page.
* {{PropertyData|ShowFrame}}: Draws an outline around the block.
* {{PropertyData|ShowFrame}}: Draws an outline around the block.
* {{PropertyData|MaxWidth}}: Limits the horizontal size of the block. A value of -1 is for unlimited width.
* {{PropertyData|MaxWidth}}: Limits the horizontal size of the block. A value of -1 is for unlimited width.
* {{PropertyData|AnnoText}}: The HTML text of the block.
* {{PropertyData|AnnoText}}: The HTML text of the block.



==Scripting== <!--T:6-->
==Scripting== <!--T:6-->


<!--T:12-->
<!--T:12-->
{{Emphasis|See also:}} [[TechDraw API|TechDraw API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:13-->
<!--T:13-->
The RichTextBlock tool can be used in [[macros|macros]] and from the [[Python|Python]] console.
The RichTextAnnotation tool can be used in [[Macros|macros]] and from the [[Python|Python]] console.

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 60: Line 80:
blockObj.AnnoText = myHTMLText
blockObj.AnnoText = myHTMLText
}}
}}

<translate>
<translate>
==Notes== <!--T:18-->
* This feature was added in v0.19
* You can edit your RichTextBlock by double clicking on it in the tree view. Double clicking in the graphics area is not yet supported.


<!--T:17-->
{{Docnav|[[TechDraw_LeaderLine|LeaderLine]]|[[TechDraw_CosmeticVertex|Cosmetic Vertex]]|[[TechDraw_Module|TechDraw]]|IconL=Techdraw-mline.svg|IconC=Workbench_TechDraw.svg|IconR=Techdraw-point.svg}}


<!--T:14-->
<!--T:17-->
{{Docnav
{{TechDraw Tools navi}}
|[[TechDraw_LeaderLine|LeaderLine]]
|[[TechDraw_CosmeticVertex|CosmeticVertex]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_LeaderLine.svg
|IconR=TechDraw_CosmeticVertex.svg
|IconC=Workbench_TechDraw.svg
}}


<!--T:15-->
{{Userdocnavi}}
</translate>
</translate>
{{TechDraw Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Latest revision as of 10:07, 26 July 2023

TechDraw RichTextAnnotation

Menu location
TechDraw → Annotations → Insert Rich Text Annotations
Workbenches
TechDraw
Default shortcut
None
Introduced in version
0.19
See also
TechDraw Annotation

Description

The TechDraw RichTextAnnotation tool adds a formatted annotation block to a Leaderline or a View.

Stand alone RichTextAnnotation

Usage

  1. If there are multiple drawing pages in the document: optionally activate the desired page by selecting it in the Tree view.
  2. To attach the RichTextAnnotation to a Leaderline, select the line in the Tree view or on the page.
  3. There are several ways to invoke the tool:
    • Press the Insert Rich Text Annotation button.
    • Select the TechDraw → Annotations → Insert Rich Text Annotation option from the menu.
  4. 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.
  5. A task panel opens.
  6. The task panel allows quick entry of text.
  7. The Start Rich Text Editor button opens a full featured editor:
    1. When done, press the button to save your changes and close the editor.
  8. Press the OK button to close the task panel.

Notes

  • After creation a RichTextAnnotation can be edited by double clicking it on the page.

Properties

  • DataX,Y: The location of the block. Relative to the end of the line if attached to a Leaderline, otherwise this is the position on the page.
  • DataShowFrame: Draws an outline around the block.
  • DataMaxWidth: Limits the horizontal size of the block. A value of -1 is for unlimited width.
  • DataAnnoText: The HTML text of the block.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

The RichTextAnnotation tool can be used in macros and from the Python console.

myPage = FreeCAD.ActiveDocument().Page
myBase = FreeCAD.ActiveDocument().View
blockObj = FreeCAD.ActiveDocument.addObject('TechDraw::DrawRichAnno','DrawRichAnno')
FreeCAD.activeDocument().myPage.addView(blockObj)
blockObj.X = 5
blockObj.Y = 5
blockObj.AnnoText = myHTMLText