Std SaveCopy: Difference between revisions

From FreeCAD Documentation
No edit summary
(Removed Preferences paragraph.)
 
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:8-->
<!--T:8-->
{{Docnav
{{Docnav
Line 35: Line 36:
<!--T:11-->
<!--T:11-->
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the command.
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the command.

==Preferences== <!--T:12-->

<!--T:13-->
* The last used file location is stored: {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath}}.


==Scripting== <!--T:14-->
==Scripting== <!--T:14-->
Line 78: Line 74:


</translate>
</translate>
{{Std Base navi{{#translation:}}}}
{{Std_Base_navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Latest revision as of 19:55, 20 April 2024

Std SaveCopy

Menu location
File → Save a Copy...
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
Std SaveAs, Std Save

Description

The Std SaveCopy command saves a copy of the active document under a new file name.

Usage

  1. Select the File → Save a Copy... option from the menu.
  2. Enter a filename in the dialog box.
  3. Press the Save button.

Options

  • Press Esc or the Cancel button to abort the command.

Scripting

See also: FreeCAD Scripting Basics.

To save a copy of a document use the saveCopy method of the document object.

import FreeCAD
from pathlib import Path

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

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

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