Std Nouveau

From FreeCAD Documentation
Revision as of 20:56, 26 March 2020 by David69 (talk | contribs) (Created page with "== Préférences ==")

Std Nouveau

Emplacement du menu
Fichier → Nouveau
Ateliers
Tous
Raccourci par défaut
Ctrl+N
Introduit dans la version
-
Voir aussi
Std Ouvrir,Std Importer

Description

La commande Std Nouveau crée un nouveau document vide et en fait le document actif.

Utilisation

  1. Lancez la commande de plusieurs manières:
  2. * Sélectionnez l'option File → Nouveau dans le menu.
  3. * Utilisez le raccourci clavier: Ctrl+N.

Préférences

  • FreeCAD will create a new document at start up if Tools → Edit parameters... → BaseApp → Preferences → Document → CreateNewDoc is set to true. This setting can also be changed in the Preferences Editor.
  • Some document properties: author names, company name and license information, can be preset in the Preferences Editor.

Properties

Most properties can also be changed in the dialog box of the Std ProjectInfo command.

  • DonnéesComment: Any comment that may apply.
  • DonnéesCompany: Company name. Can be preset.
  • DonnéesCreated By: Author name. Can be preset.
  • DonnéesCreation Date: Automatic date stamp. Not editable.
  • DonnéesFile Name: The full path of the file. Blank if the document has not been saved. Not editable.
  • DonnéesId: Not implemented yet.
  • DonnéesLabel: The name that will appear in the Tree view. By default the name of the document.
  • DonnéesLast Modified By: Author name. Can be preset.
  • DonnéesLast Modified Date: Automatic date stamp. Not editable.
  • DonnéesLicense: License type. Can be preset.
  • DonnéesLicense URL: License URL. Can be preset.
  • DonnéesShow Hidden: If true, items that have been hidden in the Tree view will be displayed anyway. Hiding items in the tree can be useful when working on larger models.
  • DonnéesTip: Not implemented yet.
  • DonnéesTip Name: Not implemented yet.
  • DonnéesTransient Dir: The transient directory used for recovery data. Not editable.

Scripting

See also: FreeCAD Scripting Basics.

To create a new document use the newDocument method of the FreeCAD application.

import FreeCAD
from pathlib import Path

# The folder and filename we will use:
fld = 'D:/testfiles/'
fnm = fld + 'test.FCStd'

# Make sure fld exists:
Path(fld).mkdir(parents=True, exist_ok=True)

doc = FreeCAD.newDocument()
doc.saveAs(fnm)

FreeCAD.closeDocument(doc.Name)

doc = FreeCAD.open(fnm)
doc.save()

FreeCAD.closeDocument(doc.Name)