Std TextDocument/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 26: Line 26:
# Chiudere la scheda e salvare il file quando viene richiesto.
# Chiudere la scheda e salvare il file quando viene richiesto.
</div>
</div>

== Properties ==

=== View ===

{{TitleProperty|Editor}}

* {{PropertyView|Font Name|Font}}: a font name provided by the system, 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 it is {{TRUE}} the text cannot be edited until this property is set to {{FALSE}}.
* {{PropertyView|Syntax Highlighter|Enumeration}}: it defaults to {{Value|None}}. If it is set to {{Value|Python}}, it will highlight the text like the [[Python_console|Python console]].


== Script ==
== Script ==
Line 50: Line 61:
}}
}}


{{Std Base navi{{#translation:}}}}
<div class="mw-translate-fuzzy">
{{Userdocnavi{{#translation:}}}}
{{Std Base/it}}
{{Userdocnavi/it}}
{{clear}}
</div>

{{Userdocnavi}}

Revision as of 21:43, 23 March 2020

Documento di testo

Posizione nel menu
Strumenti → Aggiungi un documento di testo
Ambiente
Tutti
Avvio veloce
Nessuno
Introdotto nella versione
0.19
Vedere anche
Draft Forma da testo, Draft Testo

Descrizione

Std TextDocument crea un oggetto in grado di contenere testo arbitrario. Questo elemento può essere utilizzato per scrivere delle informazioni generali o della documentazione sul modello.

Utilizzo

  1. Andare nel menu Strumenti → Aggiungi un documento di testo.
  2. Fare doppio clic sul nuovo oggetto creato nella vista ad albero per aprire una scheda in cui scrivere il testo.
  3. Aggiungere il testo.
  4. Chiudere la scheda e salvare il file quando viene richiesto.

Properties

View

Editor

  • VistaFont Name (Font): a font name provided by the system, for example, Ubuntu Mono.
  • VistaFont Size (Float): a font size in points, for example, 11.
  • VistaRead Only (Bool): it defaults to false. If it is true the text cannot be edited until this property is set to false.
  • VistaSyntax Highlighter (Enumeration): it defaults to None. If it is set to Python, it will highlight the text like the Python console.

Script

Vedere anche: Script di base per FreeCAD, e script di oggetti.

Vedere Part Feature per le informazioni generali sull'aggiunta di oggetti a un documento.

Un oggetto App::TextDocument viene creato con il metodo addObject() del documento. Una volta che esiste un TextDocument, le sue informazioni testuali vengono archiviate nel suo attributo Text. Questo attributo può essere utilizzato in altri oggetti, ad esempio, come stringa in una Forma da testo di Draft.

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()