TechDraw RichTextAnnotation: Difference between revisions

From FreeCAD Documentation
m (limit image size)
No edit summary
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
<!--T:16-->
<!--T:16-->
{{Docnav
{{Docnav
|[[TechDraw_LeaderLine|Add Leaderline to View]]
|[[TechDraw_LeaderLine|Leaderline]]
|[[TechDraw_CosmeticVertex|Add Cosmetic Vertex]]
|[[TechDraw_CosmeticVertex|Cosmetic Vertex]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Module|TechDraw]]
|IconL=TechDraw_LeaderLine.svg
|IconL=TechDraw_LeaderLine.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_CosmeticVertex.svg
|IconR=TechDraw_CosmeticVertex.svg
|IconC=Workbench_TechDraw.svg
}}
}}


Line 15: Line 15:
|Name=TechDraw RichTextAnnotation
|Name=TechDraw RichTextAnnotation
|MenuLocation=TechDraw → Annotations → Insert Rich Text Annotations
|MenuLocation=TechDraw → Annotations → Insert Rich Text Annotations
|Workbenches=[[TechDraw Module|TechDraw]]
|Workbenches=[[TechDraw_Module|TechDraw]]
|Version=0.19
|Version=0.19
|SeeAlso=[[TechDraw Templates|TechDraw Templates]], [[Draft SVG|Draft SVG]], [[TechDraw_LeaderLine|Add Leaderline to View]]
|SeeAlso=[[TechDraw_Templates|TechDraw Templates]], [[Draft_SVG|Draft SVG]], [[TechDraw_LeaderLine|TechDraw Leaderline]]
}}
}}


Line 51: Line 51:


<!--T:12-->
<!--T:12-->
{{Emphasis|See also:}} [[TechDraw API|TechDraw API]] and [[FreeCAD Scripting Basics|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|macros]] and from the [[Python|Python]] console.
The RichTextBlock tool can be used in [[Macros|macros]] and from the [[Python|Python]] console.
</translate>
</translate>
{{Code|code=
{{Code|code=
Line 74: Line 74:
<!--T:17-->
<!--T:17-->
{{Docnav
{{Docnav
|[[TechDraw_LeaderLine|Add Leaderline to View]]
|[[TechDraw_LeaderLine|Leaderline]]
|[[TechDraw_CosmeticVertex|Add Cosmetic Vertex]]
|[[TechDraw_CosmeticVertex|Cosmetic Vertex]]
|[[TechDraw_Module|TechDraw]]
|[[TechDraw_Module|TechDraw]]
|IconL=TechDraw_LeaderLine.svg
|IconL=TechDraw_LeaderLine.svg
|IconR=TechDraw_CosmeticVertex.svg
|IconC=Workbench_TechDraw.svg
|IconC=Workbench_TechDraw.svg
|IconR=TechDraw_CosmeticVertex.svg
}}
}}


<!--T:14-->
{{TechDraw Tools navi}}

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

Revision as of 21:21, 21 December 2020

TechDraw RichTextAnnotation

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

Description

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

Stand alone RichTextBlock

Usage

  1. Press the Rich Text Annotation 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.