diff --git a/Architectural Parts/Bathroom/Bathroom_cabinet_sink.FCStd b/Architectural Parts/Bathroom/Bathroom_cabinet_sink.FCStd index e285d809..5f61aa45 100644 Binary files a/Architectural Parts/Bathroom/Bathroom_cabinet_sink.FCStd and b/Architectural Parts/Bathroom/Bathroom_cabinet_sink.FCStd differ diff --git a/Architectural Parts/Bedroom/Bedroom_closet.FCStd b/Architectural Parts/Bedroom/Bedroom_closet.FCStd index b7385b71..b1b50ff7 100644 Binary files a/Architectural Parts/Bedroom/Bedroom_closet.FCStd and b/Architectural Parts/Bedroom/Bedroom_closet.FCStd differ diff --git a/Architectural Parts/Bedroom/Beds.FCStd b/Architectural Parts/Bedroom/Beds.FCStd index d5a8e2e6..72de781d 100644 Binary files a/Architectural Parts/Bedroom/Beds.FCStd and b/Architectural Parts/Bedroom/Beds.FCStd differ diff --git a/Architectural Parts/Doors_Windows/Doors_windows_module_01.FCStd b/Architectural Parts/Doors_Windows/Doors_windows_module_01.FCStd new file mode 100644 index 00000000..92f01d8d Binary files /dev/null and b/Architectural Parts/Doors_Windows/Doors_windows_module_01.FCStd differ diff --git a/Architectural Parts/Doors_Windows/Get_parametric_model.FCMacro b/Architectural Parts/Doors_Windows/Get_parametric_model.FCMacro new file mode 100644 index 00000000..26a3f80c --- /dev/null +++ b/Architectural Parts/Doors_Windows/Get_parametric_model.FCMacro @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#*************************************************************************** +#* * +#* Copyright (c) 2024 Francisco Rosa * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU Library General Public License for more details. * +#* * +#* You should have received a copy of the GNU Library General Public * +#* License along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +# Macro get model +++++++++++++++++++++++++++++++++++++++++++++++++ + +import FreeCAD +import FreeCADGui as Gui +import Spreadsheet + +# ---------------------------------------------------------------------- +## GET MODEL FROM SPREADSHEET +# ---------------------------------------------------------------------- +name = "None" +value = None +cellName = "None" +cellRows = [] +cellValue = "None" +obj = "None" +propertyType = None +propName = "None" +objects = [] +column = None +SpreadsheetModels = None +propertyRows = {} + +# Get the property name with the initial information + +propName = input("Confirme the name of the properties set or VarSet wich Label is 'Initial_information' (Ex.: Prop, Prop001, Prop002...or Varset, Varset001, Varset002...)") + +if not FreeCAD.ActiveDocument.getObject(propName): + print(str(propName) + " is not correct!" + "\n") + +# Get the spreadsheet name for saving model + +SpreadsheetModels = FreeCAD.ActiveDocument.getObject(propName).A_Spreadsheet_models + +objects = FreeCAD.ActiveDocument.getObject(propName).L_Property_objects_list + +CellRows_Lists = [] +CellRows_Lists = objects[0].L_Props_list + +# propertyRows +for i in range(len(objects)): + propertyRows [objects[i].Name] = objects[0].getPropertyByName(CellRows_Lists[i]) + +# 2. Get properties +def getComponentModel(column = "None", objects = None, propertyRows = None, SpreadsheetModels = None): + for i in range(len(objects)): + # Prop, Prop001, ...or VarSet, Varset001... + obj = objects[i] + cellRows = propertyRows[obj.Name] + for n in range(len(cellRows)): + cellValue = column + cellRows[n] + value = str(SpreadsheetModels.get(cellValue)) + if value == "Not used": + continue + cellName = "A" + cellRows[n] + name = SpreadsheetModels.get(cellName) + propertyType = obj.getTypeIdOfProperty(name) + if propertyType == "App::PropertyBool": + value = str(SpreadsheetModels.get(cellValue)) + if value == "True": + value = 1 + else: + value = 0 + setattr(obj, name, value) + continue + if propertyType == "App::PropertyInteger": + value = SpreadsheetModels.get(cellValue) + setattr(obj, name, value) + continue + setattr(obj, name, value) + + App.ActiveDocument.recompute() + +# 1. Models spreadsheet - get model column +# Condition to get model +if objects[0].B_Confirm_model == True: + objects = FreeCAD.ActiveDocument.getObject(propName).L_Property_objects_list + column = objects[0].A_Model_name[0] + getComponentModel(column, objects, propertyRows, SpreadsheetModels) + objects[0].B_Confirm_model = False + App.ActiveDocument.recompute() + # Select the Prop or VarSet + Gui.Selection.clearSelection() + Gui.Selection.addSelection(SpreadsheetModels) + Gui.Selection.clearSelection() + Gui.Selection.addSelection(objects[0]) + App.ActiveDocument.recompute() +else: + print("First you must choose or confirm the ​model name in 'Prop_General_configurations or Varset_General_configurations > I1-Get model configurations'> A_Model_name', then choose 'true' in 'B_Confirm_model!") + +#----------------------------------------------------------------------- \ No newline at end of file diff --git a/Architectural Parts/Doors_Windows/Save_parametric_models.FCMacro b/Architectural Parts/Doors_Windows/Save_parametric_models.FCMacro new file mode 100644 index 00000000..1494fea6 --- /dev/null +++ b/Architectural Parts/Doors_Windows/Save_parametric_models.FCMacro @@ -0,0 +1,181 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#*************************************************************************** +#* * +#* Copyright (c) 2024 Francisco Rosa * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU Library General Public License for more details. * +#* * +#* You should have received a copy of the GNU Library General Public * +#* License along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +# Macro Save models +++++++++++++++++++++++++++++++++++++++++++++++++ + +import FreeCAD +import FreeCADGui as Gui +import Spreadsheet + +# ---------------------------------------------------------------------- +## SAVE MODEL FROM PROPERTIES TO SPREADSHEET +# ---------------------------------------------------------------------- + +# 2. Get and save properties +# 2.1. Organize the properties + +name = "None" +value = "None" +obj = None +group = "None" +group1 = "None" +group2 = "None" +propName = 'None' +objects = [] +SpreadsheetModels = None + +# Get the property name with the initial information + +propName = input("Confirme the name of the properties set or VarSet wich Label is 'Initial_information' (Ex.: Prop, Prop001, Prop002... or VarSet, VarSet001, VarSet002...)") + +if not FreeCAD.ActiveDocument.getObject(propName): + print(str(propName) + " is not correct!" + "\n") + +# Get the spreadsheet name for saving model + +SpreadsheetModels = FreeCAD.ActiveDocument.getObject(propName).A_Spreadsheet_models + +# objects = [Prop, Prop001, ...] + +objects = FreeCAD.ActiveDocument.getObject(propName).L_Property_objects_list + +def saveComponentModel(column = "None", objects = None, SpreadsheetModels = None): + groupAnt = "None" + cellName = "None" + cellValue = "None" + N = 0 + T = 0 + cellNumber = 0 + cellValue = column + str(1) + SpreadsheetModels.setBackground(cellValue, (0.666667,0.666667,0.000000)) + for i in range(len(objects)): + # Prop, Prop001, ... + obj = objects[i] + name = "Label" + value = obj.getPropertyByName(name) + # Prop to SpreadsheetModels: + cellValue = column + str(3 + T) + SpreadsheetModels.set(cellValue, value) + SpreadsheetModels.setStyle(cellValue, 'bold', 'add') + SpreadsheetModels.setBackground(cellValue, (0.666667,0.666667,0.000000)) + App.ActiveDocument.recompute() + N += 1 + T += 1 + App.ActiveDocument.recompute() + # End save Prop to SpreadsheetModels + propertyNames = [] + propertyNames = obj.PropertiesList + groups = [] + # groups = sorted(groups) + for n in range(len(propertyNames)): + name = propertyNames[n] + group = obj.getGroupOfProperty(name) + if group not in ("", "Base"): + if group != groupAnt and group not in groups: + groups.append(group) + + groups = sorted(groups) + # Save properties + for i in range(len(groups)): + group2 = groups[i] + cellValue = column + str(3 + T) + # group background + SpreadsheetModels.setBackground(cellValue, (0.666667,0.666667,0.000000)) + App.ActiveDocument.recompute() + N += 1 + T += 1 + counter = 0 + # Save value properties by group + for n in range(len(propertyNames)): + name = propertyNames[n] + group1 = obj.getGroupOfProperty(name) + value = obj.getPropertyByName(name) + propertyType = None + propertyType = obj.getTypeIdOfProperty(name) + if group1 == group2 and name[0] != "D" and propertyType not in ('App::PropertyLink', 'App::PropertyLinkList', 'App::PropertyStringList'): + # Property to SpreadsheetModels + cellValue = column + str(3 + T) + if obj.Visibility == False: + value = "Not used" + SpreadsheetModels.set(cellValue, value) + SpreadsheetModels.setForeground(cellValue, (0.501961,0.501961,0.501961)) + else: + value = str(obj.getPropertyByName(name)) + SpreadsheetModels.set(cellValue, value) + N += 1 + T += 1 + counter += 1 + App.ActiveDocument.recompute() + # Delete group is no usefull data + if counter == 0: + N -= 1 + T -= 1 + cells = "None" + cells = column + str(2) + ":" + column + str(2000) + SpreadsheetModels.setAlignment(cells, 'center', 'keep') + SpreadsheetModels.setAlignment(cells, 'vcenter', 'keep') + App.ActiveDocument.recompute() + T = N + T += 1 + + # 3. Include the model name in the list of options. + + obj = None + listModels = [] + modelName = "None" + obj = objects[0] + modelName = column + " - " + nameTitle + " " + obj.A_General_label + listModels = obj.A_Model_list + listModels.append(modelName) + obj.A_Model_list = listModels + obj.A_Model_name = [f for f in obj.A_Model_list] + App.ActiveDocument.recompute() + +# 1. Models spreadsheet - create model title + +nameTitle = "None" +cellTitle = "None" +column = None + +# Condition to save the model +if objects[0].B_Confirm_values == True: + column = objects[0].A_New_model_column_spreadsheet + cellTitle = column + str(2) + nameTitle = objects[0].A_New_model_name + SpreadsheetModels.set(cellTitle, nameTitle) + App.ActiveDocument.recompute() + SpreadsheetModels.setStyle(cellTitle, 'bold', 'add') + App.ActiveDocument.recompute() + objects[0].B_Confirm_values = False + saveComponentModel(column, objects, SpreadsheetModels) + # Select the SpreadsheetModels + Gui.Selection.clearSelection() + Gui.Selection.addSelection(SpreadsheetModels) + App.ActiveDocument.recompute() + +else: + print("First you must write or confirm the ​spreadsheet column in 'Prop_General_configurations or VarSet_General_configurations> I2_Save_new_model'> A_New_model_column_spreadsheet', the model name in 'A_New_model_name', then choose 'true' in 'B_Confirm_values!") + +# ------------------------------------------------------------------------------------------------ \ No newline at end of file diff --git a/Architectural Parts/Doors_Windows/Videos_tutorials.txt b/Architectural Parts/Doors_Windows/Videos_tutorials.txt index 26c5802d..c75df067 100644 --- a/Architectural Parts/Doors_Windows/Videos_tutorials.txt +++ b/Architectural Parts/Doors_Windows/Videos_tutorials.txt @@ -1,3 +1,7 @@ Playlist: https://www.youtube.com/playlist?list=PLz-Uxf3mM5LWEMvdHpE3kUsUZo3kSFFjQ + +Doors_Windows_module_01: + +https://www.youtube.com/watch?v=CqzIvkohvYA diff --git a/Architectural Parts/Kitchen/Kitchen_cabinet_base.FCStd b/Architectural Parts/Kitchen/Kitchen_cabinet_base.FCStd index 0bf59dc3..e2692afb 100644 Binary files a/Architectural Parts/Kitchen/Kitchen_cabinet_base.FCStd and b/Architectural Parts/Kitchen/Kitchen_cabinet_base.FCStd differ diff --git a/Architectural Parts/Kitchen/Kitchen_cabinet_sink.FCStd b/Architectural Parts/Kitchen/Kitchen_cabinet_sink.FCStd index 45a083e9..78dac027 100644 Binary files a/Architectural Parts/Kitchen/Kitchen_cabinet_sink.FCStd and b/Architectural Parts/Kitchen/Kitchen_cabinet_sink.FCStd differ diff --git a/Architectural Parts/Kitchen/Kitchen_cabinet_superior.FCStd b/Architectural Parts/Kitchen/Kitchen_cabinet_superior.FCStd index 431c10ea..4f50656b 100644 Binary files a/Architectural Parts/Kitchen/Kitchen_cabinet_superior.FCStd and b/Architectural Parts/Kitchen/Kitchen_cabinet_superior.FCStd differ diff --git a/Architectural Parts/Kitchen/Kitchen_cabinet_vertical.FCStd b/Architectural Parts/Kitchen/Kitchen_cabinet_vertical.FCStd index 8fb1cc78..e282e38f 100644 Binary files a/Architectural Parts/Kitchen/Kitchen_cabinet_vertical.FCStd and b/Architectural Parts/Kitchen/Kitchen_cabinet_vertical.FCStd differ diff --git a/Architectural Parts/Living room/Chair.FCStd b/Architectural Parts/Living room/Chair.FCStd index c035a95c..50a148a4 100644 Binary files a/Architectural Parts/Living room/Chair.FCStd and b/Architectural Parts/Living room/Chair.FCStd differ diff --git a/Architectural Parts/Living room/Living_room_cabinet.FCStd b/Architectural Parts/Living room/Living_room_cabinet.FCStd index 758dbb94..90122a92 100644 Binary files a/Architectural Parts/Living room/Living_room_cabinet.FCStd and b/Architectural Parts/Living room/Living_room_cabinet.FCStd differ diff --git a/Architectural Parts/Living room/Rectangular_center_table.FCStd b/Architectural Parts/Living room/Rectangular_center_table.FCStd index 53623e91..0b3d01ee 100644 Binary files a/Architectural Parts/Living room/Rectangular_center_table.FCStd and b/Architectural Parts/Living room/Rectangular_center_table.FCStd differ diff --git a/Architectural Parts/Living room/Rectangular_tables.FCStd b/Architectural Parts/Living room/Rectangular_tables.FCStd index 8b2c48e0..1be1aaf4 100644 Binary files a/Architectural Parts/Living room/Rectangular_tables.FCStd and b/Architectural Parts/Living room/Rectangular_tables.FCStd differ diff --git a/Architectural Parts/Living room/Sideboard.FCStd b/Architectural Parts/Living room/Sideboard.FCStd index 428324f9..c2fa9bbf 100644 Binary files a/Architectural Parts/Living room/Sideboard.FCStd and b/Architectural Parts/Living room/Sideboard.FCStd differ diff --git a/Architectural Parts/Living room/Sofa_Armchair.FCStd b/Architectural Parts/Living room/Sofa_Armchair.FCStd index e6281b90..97a2a1a1 100644 Binary files a/Architectural Parts/Living room/Sofa_Armchair.FCStd and b/Architectural Parts/Living room/Sofa_Armchair.FCStd differ diff --git a/HVAC/Ducts/Circular/Duct_curved_circular_complete.FCStd b/HVAC/Ducts/Circular/Duct_curved_circular_complete.FCStd index 6bb3118a..02718fb0 100644 Binary files a/HVAC/Ducts/Circular/Duct_curved_circular_complete.FCStd and b/HVAC/Ducts/Circular/Duct_curved_circular_complete.FCStd differ diff --git a/HVAC/Ducts/Circular/Duct_linear_circular_complete.FCStd b/HVAC/Ducts/Circular/Duct_linear_circular_complete.FCStd index 2be59a27..e4112ba2 100644 Binary files a/HVAC/Ducts/Circular/Duct_linear_circular_complete.FCStd and b/HVAC/Ducts/Circular/Duct_linear_circular_complete.FCStd differ diff --git a/HVAC/Ducts/Circular_oval/Duct_curved_circular_oval_complete.FCStd b/HVAC/Ducts/Circular_oval/Duct_curved_circular_oval_complete.FCStd index 2164e309..f7e2922d 100644 Binary files a/HVAC/Ducts/Circular_oval/Duct_curved_circular_oval_complete.FCStd and b/HVAC/Ducts/Circular_oval/Duct_curved_circular_oval_complete.FCStd differ diff --git a/HVAC/Ducts/Circular_oval/Duct_linear_circular_oval_complete.FCStd b/HVAC/Ducts/Circular_oval/Duct_linear_circular_oval_complete.FCStd index d9966927..e0cc9df2 100644 Binary files a/HVAC/Ducts/Circular_oval/Duct_linear_circular_oval_complete.FCStd and b/HVAC/Ducts/Circular_oval/Duct_linear_circular_oval_complete.FCStd differ diff --git a/HVAC/Ducts/Flex/Duct_flex_complete.FCStd b/HVAC/Ducts/Flex/Duct_flex_complete.FCStd index aec7db09..02a31830 100644 Binary files a/HVAC/Ducts/Flex/Duct_flex_complete.FCStd and b/HVAC/Ducts/Flex/Duct_flex_complete.FCStd differ diff --git a/HVAC/Ducts/Oval/Duct_curved_oval_complete.FCStd b/HVAC/Ducts/Oval/Duct_curved_oval_complete.FCStd index cb032d41..f2dd156d 100644 Binary files a/HVAC/Ducts/Oval/Duct_curved_oval_complete.FCStd and b/HVAC/Ducts/Oval/Duct_curved_oval_complete.FCStd differ diff --git a/HVAC/Ducts/Oval/Duct_linear_oval_complete.FCStd b/HVAC/Ducts/Oval/Duct_linear_oval_complete.FCStd index 1c1fc44b..0da895ea 100644 Binary files a/HVAC/Ducts/Oval/Duct_linear_oval_complete.FCStd and b/HVAC/Ducts/Oval/Duct_linear_oval_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular/Duct_curved_rectangular_complete.FCStd b/HVAC/Ducts/Rectangular/Duct_curved_rectangular_complete.FCStd index 835573a8..dc2df03a 100644 Binary files a/HVAC/Ducts/Rectangular/Duct_curved_rectangular_complete.FCStd and b/HVAC/Ducts/Rectangular/Duct_curved_rectangular_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular/Duct_linear_rectangular_complete.FCStd b/HVAC/Ducts/Rectangular/Duct_linear_rectangular_complete.FCStd index c66e6e75..dd17491f 100644 Binary files a/HVAC/Ducts/Rectangular/Duct_linear_rectangular_complete.FCStd and b/HVAC/Ducts/Rectangular/Duct_linear_rectangular_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular_circular/Duct_curved_rectangular_circular_complete.FCStd b/HVAC/Ducts/Rectangular_circular/Duct_curved_rectangular_circular_complete.FCStd index d229251d..394ced2f 100644 Binary files a/HVAC/Ducts/Rectangular_circular/Duct_curved_rectangular_circular_complete.FCStd and b/HVAC/Ducts/Rectangular_circular/Duct_curved_rectangular_circular_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular_circular/Duct_linear_rectangular_circular_complete.FCStd b/HVAC/Ducts/Rectangular_circular/Duct_linear_rectangular_circular_complete.FCStd index 9079f797..0b1ac1c2 100644 Binary files a/HVAC/Ducts/Rectangular_circular/Duct_linear_rectangular_circular_complete.FCStd and b/HVAC/Ducts/Rectangular_circular/Duct_linear_rectangular_circular_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular_oval/Duct_curved_rectangular_oval_complete.FCStd b/HVAC/Ducts/Rectangular_oval/Duct_curved_rectangular_oval_complete.FCStd index 5d9bdff0..b72259ff 100644 Binary files a/HVAC/Ducts/Rectangular_oval/Duct_curved_rectangular_oval_complete.FCStd and b/HVAC/Ducts/Rectangular_oval/Duct_curved_rectangular_oval_complete.FCStd differ diff --git a/HVAC/Ducts/Rectangular_oval/Duct_linear_rectangular_oval_complete.FCStd b/HVAC/Ducts/Rectangular_oval/Duct_linear_rectangular_oval_complete.FCStd index 500bf5b4..330d3a08 100644 Binary files a/HVAC/Ducts/Rectangular_oval/Duct_linear_rectangular_oval_complete.FCStd and b/HVAC/Ducts/Rectangular_oval/Duct_linear_rectangular_oval_complete.FCStd differ diff --git a/Topography/Parametric_terrain.FCStd b/Topography/Parametric_terrain.FCStd new file mode 100644 index 00000000..070733fe Binary files /dev/null and b/Topography/Parametric_terrain.FCStd differ diff --git a/Topography/Terrain.txt b/Topography/Terrain.txt new file mode 100644 index 00000000..ff3a6695 --- /dev/null +++ b/Topography/Terrain.txt @@ -0,0 +1 @@ +https://forum.freecad.org/viewtopic.php?p=803014#p803014