Std TextDocument

From LabRPS Documentation
Revision as of 09:15, 27 October 2024 by LabRPS (talk | contribs) (Created page with "{{Docnav |ProjectUtil |Group |Std Tools Menu |IconL=Std_ProjectUtil.svg |IconR=Std_Group.svg |IconC=Labrps.svg }} {{GuiCommand |Name=Std TextDocument |MenuLocation=Tools → Add text document |Phenomena=All }} ==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== # S...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Arrow-left.svg Previous: Std ProjectUtil.svg ProjectUtil
Next: Group Std Group.svg Arrow-right.svg

Std TextDocument.svg Std TextDocument

Menu location
Tools → Add text document
Phenomena
All
Default shortcut
None
Introduced in version
-
See also
None

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

  1. Select the Tools → Std TextDocument.svg Add text document option from the menu.
  2. Double-click the newly created object in the Tree view to open a tab in which to write text.
  3. Add text.
  4. 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 to false. If set to true the text cannot be edited.
  • ViewSyntax Highlighter (Enumeration): it defaults to None. If set to Python, the text will be highlighted like the Python console.

Scripting

See also: Autogenerated API documentation and LabRPS Scripting Basics.


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.

import LabRPS as App
import Draft

doc = App.newDocument()
obj = doc.addObject("App::TextDocument", "Text_document")
obj.Text = "textual information"
doc.recompute()

doc.recompute()


Arrow-left.svg Previous: Std ProjectUtil.svg ProjectUtil
Next: Group Std Group.svg Arrow-right.svg