Std SaveCopy: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Page in progress}}

<translate>
<translate>
<!--T:8-->
{{Docnav
{{Docnav
|[[Std_SaveAs|Std SaveAs]]
|[[Std_SaveAs|SaveAs]]
|[[Std_SaveAll|Std SaveAll]]
|[[Std_SaveAll|SaveAll]]
|[[Std_File_Menu|Std File Menu]]
|[[Std_File_Menu|Std File Menu]]
|IconL=Std_SaveAs.svg
|IconL=Std_SaveAs.svg
|IconR=
|IconR=Std_SaveAll.svg
|IconC=Freecad.svg
|IconC=Freecad.svg
}}
}}
Line 18: Line 16:
|MenuLocation=File → Save a Copy...
|MenuLocation=File → Save a Copy...
|Workbenches=All
|Workbenches=All
|Shortcut=-
|SeeAlso=[[Std_SaveAs|Std SaveAs]], [[Std_Save|Std Save]]
|SeeAlso=[[Std_SaveAs|Std SaveAs]], [[Std_Save|Std Save]]
|Version=-
}}
}}


==Description== <!--T:2-->
==Description== <!--T:2-->


<!--T:9-->
The '''Std SaveCopy''' command saves a copy of the current document under a new file name.
The '''Std SaveCopy''' command saves a copy of the active document under a new file name.


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:6-->
<!--T:6-->
# Select the {{MenuCommand|File → Save a Copy...}} option from the menu.
# Select the {{MenuCommand|File → [[Image:Std_SaveCopy.svg|16px]] Save a Copy...}} option from the menu.
# Enter a filename in the dialog box.
# Enter a filename in the dialog box.
# Press the {{Button|Save}} button.
# Press the {{Button|Save}} button.


==Options== <!--T:10-->

<!--T:11-->
* 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-->

<!--T:15-->
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

<!--T:16-->
To save a copy of a document use the {{incode|saveCopy}} method of the document object.

</translate>
{{Code|code=
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)
}}
<translate>


<!--T:17-->
{{Docnav
{{Docnav
|[[Std_SaveAs|Std SaveAs]]
|[[Std_SaveAs|SaveAs]]
|[[Std_SaveAll|Std SaveAll]]
|[[Std_SaveAll|SaveAll]]
|[[Std_File_Menu|Std File Menu]]
|[[Std_File_Menu|Std File Menu]]
|IconL=Std_SaveAs.svg
|IconL=Std_SaveAs.svg
|IconR=
|IconR=Std_SaveAll.svg
|IconC=Freecad.svg
|IconC=Freecad.svg
}}
}}

Revision as of 17:37, 24 December 2020

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.

Preferences

  • The last used file location is stored: Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath.

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)