Std MergeProjects: Difference between revisions

From FreeCAD Documentation
No edit summary
(Scripting)
Line 40: Line 40:
* A project cannot be merged with itself, selecting the current file is not allowed.
* A project cannot be merged with itself, selecting the current file is not allowed.
* FreeCAD will automatically change the internal names and, depending on the preferences, labels of objects to avoid name conflicts.
* FreeCAD will automatically change the internal names and, depending on the preferences, labels of objects to avoid name conflicts.
* To run the command in Python see this forum topic: https://forum.freecadweb.org/viewtopic.php?t=2579


==Preferences== <!--T:16-->
==Preferences== <!--T:16-->
Line 47: Line 46:
* The last used file location is stored: {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath}}.
* The last used file location is stored: {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath}}.
* Duplicate labels are allowed if {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → Document → DuplicateLabels}} is set to {{TRUE}}. This setting can also be changed in the [[Preferences_Editor#Document|Preferences Editor]].
* Duplicate labels are allowed if {{MenuCommand|Tools → Edit parameters... → BaseApp → Preferences → Document → DuplicateLabels}} is set to {{TRUE}}. This setting can also be changed in the [[Preferences_Editor#Document|Preferences Editor]].

==Scripting==

{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To merge a project use the {{Incode|mergeProject}} method of the document object.

</translate>
{{Code|code=
import FreeCAD

FreeCAD.ActiveDocument.mergeProject("Path_to_FCStd_project_file")
}}
<translate>





Revision as of 11:28, 22 January 2023

Std MergeProjects

Menu location
File → Merge project...
Workbenches
All
Default shortcut
None
Introduced in version
-
See also
None

Description

The Std MergeProjects command adds the contents of a FreeCAD file into the active document.

Usage

  1. Select the File → Merge project... option from the menu.
  2. Select a FreeCAD file in the dialog box.
  3. Press the Open button.

Options

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

Notes

  • A project cannot be merged with itself, selecting the current file is not allowed.
  • FreeCAD will automatically change the internal names and, depending on the preferences, labels of objects to avoid name conflicts.

Preferences

  • The last used file location is stored: Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath.
  • Duplicate labels are allowed if Tools → Edit parameters... → BaseApp → Preferences → Document → DuplicateLabels is set to true. This setting can also be changed in the Preferences Editor.

Scripting

See also: FreeCAD Scripting Basics.

To merge a project use the mergeProject method of the document object.

import FreeCAD

FreeCAD.ActiveDocument.mergeProject("Path_to_FCStd_project_file")