Std TextDocument: Difference between revisions
m (added template) |
mNo edit summary |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
⚫ | |||
{{Docnav |
|||
|[[Std_MeasureDistance|MeasureDistance]] |
|||
|[[Std_DemoMode|DemoMode]] |
|||
|[[Std_Tools_Menu|Std Tools Menu]] |
|||
|IconL=Std_MeasureDistance.svg |
|||
|IconR=Std_DemoMode.svg |
|||
|IconC=Freecad.svg |
|||
}} |
|||
<!--T:1--> |
<!--T:1--> |
||
{{GuiCommand |
{{GuiCommand |
||
|Name=Std TextDocument |
|Name=Std TextDocument |
||
|MenuLocation= |
|MenuLocation=Tools → Add text document |
||
|Workbenches=All |
|Workbenches=All |
||
|Version=0.19 |
|Version=0.19 |
||
Line 11: | Line 21: | ||
}} |
}} |
||
== |
==Description== <!--T:2--> |
||
<!--T:3--> |
<!--T:3--> |
||
The '''Std TextDocument''' command creates an object capable of holding arbitrary text. This element can be used to write general information or documentation about the model. |
|||
== |
==Usage== <!--T:4--> |
||
<!--T:5--> |
<!--T:5--> |
||
# |
# Select the {{MenuCommand|Tools → Add text document}} option from the menu. |
||
# Double |
# Double-click the newly created object in the [[tree view|tree view]] to open a tab in which to write text. |
||
# Add text. |
# Add text. |
||
# Close the tab and save the file when asked. |
# Close the tab and save the file when asked. |
||
== |
==Properties== <!--T:12--> |
||
===View=== <!--T:13--> |
|||
<!--T:14--> |
|||
{{TitleProperty|Editor}} |
|||
<!--T:15--> |
|||
* {{PropertyView|Font Name|Font}}: a font name, for example, {{Value|Ubuntu Mono}}. |
|||
* {{PropertyView|Font Size|Float}}: a font size in points, for example, {{Value|11}}. |
|||
* {{PropertyView|Read Only|Bool}}: it defaults to {{FALSE}}. If set to {{TRUE}} the text cannot be edited. |
|||
* {{PropertyView|Syntax Highlighter|Enumeration}}: it defaults to {{Value|None}}. If set to {{Value|Python}}, the text will be highlighted like the [[Python_console|Python console]]. |
|||
==Scripting== <!--T:6--> |
|||
<!--T:7--> |
<!--T:7--> |
||
Line 33: | Line 56: | ||
<!--T:9--> |
<!--T:9--> |
||
An {{incode|App::TextDocument}} object is created with the {{incode|addObject()}} method of the document. Once a TextDocument exists, its textual information is stored in its {{incode|Text}} attribute. This attribute can be used in other objects, for example, as the string in a [[Draft_ShapeString|Draft ShapeString]]. |
An {{incode|App::TextDocument}} object is created with the {{incode|addObject()}} method of the document. Once a TextDocument exists, its textual information is stored in its {{incode|Text}} attribute. This attribute can be used in other objects, for example, as the string in a {{Button|[[Image:Draft_ShapeString.svg|16px]] [[Draft_ShapeString|Draft ShapeString]]}}. |
||
</translate> |
</translate> |
||
Line 50: | Line 73: | ||
<translate> |
<translate> |
||
⚫ | |||
⚫ | |||
<!--T: |
<!--T:17--> |
||
{{Docnav |
|||
⚫ | |||
|[[Std_MeasureDistance|MeasureDistance]] |
|||
|[[Std_DemoMode|DemoMode]] |
|||
|[[Std_Tools_Menu|Std Tools Menu]] |
|||
|IconL=Std_MeasureDistance.svg |
|||
|IconR=Std_DemoMode.svg |
|||
|IconC=Freecad.svg |
|||
}} |
|||
</translate> |
</translate> |
||
⚫ | |||
⚫ | |||
{{clear}} |
Latest revision as of 15:48, 29 December 2020
Std TextDocument |
Menu location |
---|
Tools → Add text document |
Workbenches |
All |
Default shortcut |
None |
Introduced in version |
0.19 |
See also |
Draft ShapeString, Draft Text |
Description
The Std TextDocument command creates an object capable of holding arbitrary text. This element can be used to write general information or documentation about the model.
Usage
- Select the Tools → Add text document option from the menu.
- Double-click the newly created object in the tree view to open a tab in which to write text.
- Add text.
- Close the tab and save the file when asked.
Properties
View
Editor
- ViewFont Name (
Font
): a font name, for example,Ubuntu Mono
. - ViewFont Size (
Float
): a font size in points, for example,11
. - ViewRead Only (
Bool
): it defaults tofalse
. If set totrue
the text cannot be edited. - ViewSyntax Highlighter (
Enumeration
): it defaults toNone
. If set toPython
, the text will be highlighted like the Python console.
Scripting
See also: FreeCAD Scripting Basics, and scripted objects.
See Part Feature for the general information on adding objects to a document.
An App::TextDocument
object is created with the addObject()
method of the document. Once a TextDocument exists, its textual information is stored in its Text
attribute. This attribute can be used in other objects, for example, as the string in a Draft ShapeString.
import FreeCAD as App
import Draft
doc = App.newDocument()
obj = App.ActiveDocument.addObject("App::TextDocument", "Text_document")
obj.Text = "textual information"
App.ActiveDocument.recompute()
obj2 = Draft.makeShapeString(obj.Text, "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 10)
App.ActiveDocument.recompute()
Std Base
- File: New, Open, Close, Close All, Save, Save As, Save a Copy, Save All, Revert, Import, Export,Merge project, Project information, Print, Print preview, Export PDF, Recent files, Exit
- Edit: Undo, Redo, Cut, Copy, Paste, Duplicate selection, Refresh, Box selection, Box element selection, Select All, Delete, Send to Python Console, Placement, Transform, Alignment, Toggle Edit mode, Edit mode, Preferences
- View:
- Miscellaneous: Create new view, Orthographic view, Perspective view, Fullscreen, Bounding box, Toggle axis cross, Clipping plane, Texture mapping, Toggle navigation/Edit mode, Appearance, Random color, Workbench, Status bar
- Standard views: Fit all, Fit selection, Isometric, Dimetric, Trimetric, Home, Front, Top, Right, Rear, Bottom, Left, Rotate Left, Rotate Right
- Freeze display: Save views, Load views, Freeze view, Clear views
- Draw style: As is, Points, Wireframe, Hidden line, No shading, Shaded, Flat lines
- Stereo: Stereo red/cyan, Stereo quad buffer, Stereo Interleaved Rows, Stereo Interleaved Columns, Stereo Off, Issue camera position
- Zoom: Zoom In, Zoom Out, Box zoom
- Document window: Docked, Undocked, Fullscreen
- Visibility: Toggle visibility, Show selection, Hide selection, Select visible objects, Toggle all objects, Show all objects, Hide all objects, Toggle selectability, Toggle measurement, Clear measurement
- Toolbars: File, Edit, Clipboard, Workbench, Macro, View, Structure, Help
- Panels: Tree view, Property view, Selection view, Tasks, Python console, DAG view, Model, Report view
- Link navigation: Go to linked object, Go to the deepest linked object, Select all links
- Tree view actions: Sync view, Sync selection, Sync placement, Pre-selection, Record selection, Single document, Multi document, Collapse/Expand, Initiate dragging, Go to selection, Selection Back, Selection Forward
- Tools: Edit parameters, Save image, Load image, Scene inspector, Dependency graph, Project utility, Measure distance, Add text document, View turntable, Units calculator, Customize, Addon manager
- Macro: Macro recording, Macros, Recent macros, Execute macro, Attach to remote debugger, Debug macro, Stop debugging, Step over, Step into, Toggle breakpoint
- Help: Help, FreeCAD Website, Donate, Users documentation, Python scripting documentation, Automatic Python modules documentation, FreeCAD Forum, FreeCAD FAQ, Report a bug, About FreeCAD, What's This
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub