Std Nouveau

From FreeCAD Documentation
Revision as of 21:00, 26 March 2020 by David69 (talk | contribs) (Created page with "* FreeCAD créera un nouveau document au démarrage si {{MenuCommand|Outils → Editer paramètres ... → BaseApp → Preferences → Document → CreateNewDoc}} est réglé...")

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 créera un nouveau document au démarrage si Outils → Editer paramètres ... → BaseApp → Preferences → Document → CreateNewDoc est réglé sur true. Ce paramètre peut également être modifié dans les Réglage des préférences.
  • Certaines propriétés du document: noms d'auteur, nom de l'entreprise et informations de licence, peuvent être prédéfinies dans Réglage des préférences.

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)