diff --git a/data/examples/AssemblyExample.FCStd b/data/examples/AssemblyExample.FCStd new file mode 100644 index 0000000000..d32999a859 Binary files /dev/null and b/data/examples/AssemblyExample.FCStd differ diff --git a/data/examples/CMakeLists.txt b/data/examples/CMakeLists.txt index a93957637b..3ebfb2e6a8 100644 --- a/data/examples/CMakeLists.txt +++ b/data/examples/CMakeLists.txt @@ -9,6 +9,7 @@ SET(Examples_Files FemCalculixCantilever2D.FCStd FemCalculixCantilever3D.FCStd FemCalculixCantilever3D_newSolver.FCStd + AssemblyExample.FCStd ) ADD_CUSTOM_TARGET(Example_data ALL diff --git a/src/Mod/Start/StartPage/CMakeLists.txt b/src/Mod/Start/StartPage/CMakeLists.txt index 5d363bb972..8ae01d93b3 100644 --- a/src/Mod/Start/StartPage/CMakeLists.txt +++ b/src/Mod/Start/StartPage/CMakeLists.txt @@ -26,6 +26,7 @@ SET(StartPage_ImageResources images/installed.png images/new_file_thumbnail.svg images/icon_settings.png + images/new_assembly.png images/new_empty_file.png images/new_open_file.png images/new_parametric_part.png diff --git a/src/Mod/Start/StartPage/LoadNew.py b/src/Mod/Start/StartPage/LoadNew.py index 71b6063c9c..fa9c317b15 100644 --- a/src/Mod/Start/StartPage/LoadNew.py +++ b/src/Mod/Start/StartPage/LoadNew.py @@ -40,6 +40,12 @@ elif template_name == "parametric_part": FreeCADGui.activateWorkbench("PartDesignWorkbench") FreeCADGui.runCommand("PartDesign_Body") StartPage.postStart(False) +elif template_name == "assembly": + FreeCADGui.runCommand("Std_New") + FreeCADGui.activateWorkbench("AssemblyWorkbench") + FreeCADGui.runCommand("Assembly_CreateAssembly") + FreeCADGui.runCommand("Std_Refresh") + StartPage.postStart(False) # elif template_name == "csg_part": # FreeCADGui.runCommand('Std_New') # FreeCADGui.activateWorkbench("PartWorkbench") diff --git a/src/Mod/Start/StartPage/StartPage.py b/src/Mod/Start/StartPage/StartPage.py index c01f5b689c..7025843d2c 100644 --- a/src/Mod/Start/StartPage/StartPage.py +++ b/src/Mod/Start/StartPage/StartPage.py @@ -321,6 +321,10 @@ def build_new_file_card(template): TranslationTexts.get("T_TEMPLATE_PARAMETRICPART_NAME"), TranslationTexts.get("T_TEMPLATE_PARAMETRICPART_DESC"), ], + "assembly": [ + TranslationTexts.get("T_TEMPLATE_ASSEMBLY_NAME"), + TranslationTexts.get("T_TEMPLATE_ASSEMBLY_DESC"), + ], # "csg_part": [TranslationTexts.get("T_TEMPLATE_CSGPART_NAME"), TranslationTexts.get("T_TEMPLATE_CSGPART_DESC")], "2d_draft": [ TranslationTexts.get("T_TEMPLATE_2DDRAFT_NAME"), @@ -553,6 +557,7 @@ def handle(): SECTION_NEW_FILE += build_new_file_card("empty_file") SECTION_NEW_FILE += build_new_file_card("open_file") SECTION_NEW_FILE += build_new_file_card("parametric_part") + SECTION_NEW_FILE += build_new_file_card("assembly") # SECTION_NEW_FILE += build_new_file_card("csg_part") SECTION_NEW_FILE += build_new_file_card("2d_draft") SECTION_NEW_FILE += build_new_file_card("architecture") diff --git a/src/Mod/Start/StartPage/TranslationTexts.py b/src/Mod/Start/StartPage/TranslationTexts.py index 655cfd5bfe..8f6d1b428c 100644 --- a/src/Mod/Start/StartPage/TranslationTexts.py +++ b/src/Mod/Start/StartPage/TranslationTexts.py @@ -55,6 +55,8 @@ def get(handle): T_TEMPLATE_PARAMETRICPART_DESC = translate( "StartPage", "Create a part with the Part Design workbench" ) + T_TEMPLATE_ASSEMBLY_NAME = translate("StartPage", "Assembly") + T_TEMPLATE_ASSEMBLY_DESC = translate("StartPage", "Create an assembly project") # T_TEMPLATE_CSGPART_NAME = translate("StartPage", "CSG Part") # T_TEMPLATE_CSGPART_DESC = translate("StartPage", "Create a part with the Part workbench") T_TEMPLATE_2DDRAFT_NAME = translate("StartPage", "2D Draft") diff --git a/src/Mod/Start/StartPage/images/new_assembly.png b/src/Mod/Start/StartPage/images/new_assembly.png new file mode 100644 index 0000000000..ee6401852a Binary files /dev/null and b/src/Mod/Start/StartPage/images/new_assembly.png differ