TechDraw RichTextAnnotation: Difference between revisions

From FreeCAD Documentation
(Created page with "<languages/> <translate> <!--T:16--> {{Docnav|LeaderLine|Hatching|TechDraw|IconL=TechDraw_Tree_Page_Sync.png|...")
 
No edit summary
(7 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:16-->
<!--T:16-->
{{Docnav
{{Docnav|[[TechDraw_LeaderLine|LeaderLine]]|[[TechDraw_Hatching|Hatching]]|[[TechDraw_Module|TechDraw]]|IconL=TechDraw_Tree_Page_Sync.png|IconC=Workbench_TechDraw.svg|IconR=}}
|[[TechDraw_LeaderLine|LeaderLine]]
|[[TechDraw_CosmeticVertex|Cosmetic Vertex]]
|[[TechDraw_Module|TechDraw]]
|IconL=Techdraw-mline.svg
|IconC=Workbench_TechDraw.svg
|IconR=Techdraw-point.svg
}}


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


Line 16: Line 24:


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


</translate>
</translate>
Line 31: Line 39:
# The Start Rich Text Editor button will open a full featured editor. Press the Save icon to record your changes.
# The Start Rich Text Editor button will open a full featured editor. Press the Save icon to record your changes.
# After the block is created, it can be edited by double clicking the RichTextBlock in the Tree.
# After the block is created, it can be edited by double clicking the RichTextBlock in the Tree.
# To attach the block to a [[LeaderLine]], select the line before starting the RichTextBlock tool.
# To attach the block to a [[TechDraw_LeaderLine|LeaderLine]], select the line before starting the RichTextBlock tool.




Line 37: Line 45:


<!--T:20-->
<!--T:20-->
* {{PropertyData|X,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.
* {{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.
Line 46: Line 54:


<!--T:12-->
<!--T:12-->
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[TechDraw API|TechDraw API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:13-->
<!--T:13-->
The RichTextBlock tool can be used in [[macros]] and from the [[Python]] console.
The RichTextBlock tool can be used in [[macros|macros]] and from the [[Python|Python]] console.
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 63: Line 71:
<translate>
<translate>
==Notes== <!--T:18-->
==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.
* 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-->
<!--T:17-->
{{Docnav
{{Docnav|[[TechDraw_LeaderLine|LeaderLine]]|[[TechDraw_Hatching|Hatching]]|[[TechDraw_Module|TechDraw]]|IconL=TechDraw_Tree_Page_Sync.png|IconC=Workbench_TechDraw.svg|IconR=}}
|[[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:14-->

Revision as of 12:52, 8 December 2019

File:Techdraw-textleader.svg TechDraw RichTextBlock

Menu location
TechDraw → Annotations → Insert Rich Text Annotations
Workbenches
TechDraw
Default shortcut
None
Introduced in version
0.19
See also
TechDraw Templates, Draft SVG, LeaderLine

Description

The RichTextBlock tool adds a formatted annotation block to a LeaderLine or a View.

Stand alone RichTextBlock

How to use

  1. Press the File:Techdraw-textleader.svg RichTextBlock button
  2. A Task dialog will open. The dialog allows quick entry of text.
  3. The Start Rich Text Editor button will open a full featured editor. Press the Save icon to record your changes.
  4. After the block is created, it can be edited by double clicking the RichTextBlock in the Tree.
  5. To attach the block to a LeaderLine, select the line before starting the RichTextBlock tool.


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: TechDraw API and FreeCAD Scripting Basics.

The RichTextBlock 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

Notes

  • You can edit your RichTextBlock by double clicking on it in the tree view. Double clicking in the graphics area is not yet supported.