Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add updated parametric components. #435

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
0df1620
Create txt
Francisco-Rosa Oct 15, 2024
e957dc4
Create txt
Francisco-Rosa Oct 15, 2024
faa0655
Add files via upload
Francisco-Rosa Oct 15, 2024
8f13d0b
Delete Architectural Parts/Bedroom/txt
Francisco-Rosa Oct 15, 2024
3b9432a
Delete Architectural Parts/Bedroom/Images/txt
Francisco-Rosa Oct 15, 2024
ed4b0ba
Delete Architectural Parts/Bedroom/Images/Bed_double_image_01.jpg
Francisco-Rosa Oct 15, 2024
158e9df
Delete Architectural Parts/Bedroom/Images/Bed_single_image_01.jpg
Francisco-Rosa Oct 15, 2024
6093a6e
Create txt
Francisco-Rosa Oct 15, 2024
ba82fc8
Add R00
Francisco-Rosa Oct 15, 2024
0c570be
Delete Architectural Parts/Bedroom/txt
Francisco-Rosa Oct 15, 2024
54c2f93
Create txt
Francisco-Rosa Oct 15, 2024
3f6739b
Add files via upload
Francisco-Rosa Oct 15, 2024
24b3591
Delete Architectural Parts/Bedroom/Images/txt
Francisco-Rosa Oct 15, 2024
d83d85c
Add R03
Francisco-Rosa Oct 15, 2024
ce67c2c
Add files via upload
Francisco-Rosa Oct 15, 2024
59d22e7
Add R00
Francisco-Rosa Oct 15, 2024
bf56083
Add files via upload
Francisco-Rosa Oct 15, 2024
d2b3efa
R00
Francisco-Rosa Oct 15, 2024
6ac3384
Add files via upload
Francisco-Rosa Oct 15, 2024
8fa4a90
Add R01
Francisco-Rosa Oct 15, 2024
a5b4dbe
Add files via upload
Francisco-Rosa Oct 15, 2024
b00fdfd
Add R01
Francisco-Rosa Oct 15, 2024
00257ae
Add files via upload
Francisco-Rosa Oct 15, 2024
301c1fb
Add R00
Francisco-Rosa Oct 15, 2024
2bb9315
Add files via upload
Francisco-Rosa Oct 15, 2024
6486c6b
R02
Francisco-Rosa Oct 15, 2024
0cfa98d
Create txt
Francisco-Rosa Oct 15, 2024
61af73a
Add files via upload
Francisco-Rosa Oct 15, 2024
125c1f7
Delete Architectural Parts/Windows/Casement/Images/txt
Francisco-Rosa Oct 15, 2024
340afef
Add R02
Francisco-Rosa Oct 16, 2024
7c12587
Add R03
Francisco-Rosa Oct 16, 2024
dbc1ccf
Add R01
Francisco-Rosa Oct 19, 2024
6cb977d
Add R01
Francisco-Rosa Oct 19, 2024
265710d
Add R04
Francisco-Rosa Oct 19, 2024
e0bc983
Add R01
Francisco-Rosa Oct 19, 2024
1970de2
Add R02
Francisco-Rosa Oct 19, 2024
b5e5304
Add R03
Francisco-Rosa Oct 19, 2024
f8e98c6
Add R03
Francisco-Rosa Oct 19, 2024
13b86c5
Add R03
Francisco-Rosa Oct 19, 2024
5f7b2bb
Add R01
Francisco-Rosa Oct 19, 2024
1b28fed
Add R04
Francisco-Rosa Oct 19, 2024
c321f7b
Merge branch 'FreeCAD:master' into master
Francisco-Rosa Dec 29, 2024
53ae5d1
Add R04
Francisco-Rosa Dec 29, 2024
a146d25
Add R02
Francisco-Rosa Dec 29, 2024
c65a8ae
Add R03
Francisco-Rosa Dec 29, 2024
112792d
Add R02
Francisco-Rosa Dec 29, 2024
a2aafb2
Add R06
Francisco-Rosa Dec 29, 2024
cd99835
Add R07
Francisco-Rosa Dec 29, 2024
29a9ffe
Add R04
Francisco-Rosa Dec 29, 2024
fe76ed1
Add R05
Francisco-Rosa Dec 29, 2024
563d47a
Add R02
Francisco-Rosa Dec 29, 2024
e5e0ab1
Add R03
Francisco-Rosa Dec 29, 2024
257375c
Add R04
Francisco-Rosa Dec 29, 2024
4126c3e
Add R04
Francisco-Rosa Dec 29, 2024
18a948a
Add R04
Francisco-Rosa Dec 29, 2024
829e9f2
Add R02
Francisco-Rosa Dec 29, 2024
6de4e3b
Add R04
Francisco-Rosa Dec 29, 2024
d12c79d
Add R04
Francisco-Rosa Dec 29, 2024
42790db
Add R03
Francisco-Rosa Dec 29, 2024
b7acd9c
Add R03
Francisco-Rosa Dec 29, 2024
2da942c
Add R03
Francisco-Rosa Dec 29, 2024
0719550
Add R03
Francisco-Rosa Dec 29, 2024
8598f17
Add R03
Francisco-Rosa Dec 29, 2024
ef02cf0
Add R04
Francisco-Rosa Dec 29, 2024
f0090eb
Add R04
Francisco-Rosa Dec 29, 2024
bb40edd
Add R04
Francisco-Rosa Dec 29, 2024
06406b9
Add R03
Francisco-Rosa Dec 29, 2024
8179c64
Add R00
Francisco-Rosa Dec 29, 2024
d2acba2
Add R03
Francisco-Rosa Dec 30, 2024
f43a4c9
Add R04
Francisco-Rosa Jan 2, 2025
ef9adc9
Add R05
Francisco-Rosa Jan 3, 2025
47e761e
Update Videos_tutorials.txt
Francisco-Rosa Jan 5, 2025
e44576f
Update Videos_tutorials.txt
Francisco-Rosa Jan 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Architectural Parts/Bathroom/Bathroom_cabinet_sink.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Bedroom/Bedroom_closet.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Bedroom/Beds.FCStd
Binary file not shown.
Binary file not shown.
115 changes: 115 additions & 0 deletions Architectural Parts/Doors_Windows/Get_parametric_model.FCMacro
Original file line number Diff line number Diff line change
@@ -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!")

#-----------------------------------------------------------------------
181 changes: 181 additions & 0 deletions Architectural Parts/Doors_Windows/Save_parametric_models.FCMacro
Original file line number Diff line number Diff line change
@@ -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!")

# ------------------------------------------------------------------------------------------------
4 changes: 4 additions & 0 deletions Architectural Parts/Doors_Windows/Videos_tutorials.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Playlist:

https://www.youtube.com/playlist?list=PLz-Uxf3mM5LWEMvdHpE3kUsUZo3kSFFjQ

Doors_Windows_module_01:

https://www.youtube.com/watch?v=CqzIvkohvYA
Binary file modified Architectural Parts/Kitchen/Kitchen_cabinet_base.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Kitchen/Kitchen_cabinet_sink.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Kitchen/Kitchen_cabinet_superior.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Kitchen/Kitchen_cabinet_vertical.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Chair.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Living_room_cabinet.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Rectangular_center_table.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Rectangular_tables.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Sideboard.FCStd
Binary file not shown.
Binary file modified Architectural Parts/Living room/Sofa_Armchair.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Circular/Duct_curved_circular_complete.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Circular/Duct_linear_circular_complete.FCStd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified HVAC/Ducts/Flex/Duct_flex_complete.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Oval/Duct_curved_oval_complete.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Oval/Duct_linear_oval_complete.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Rectangular/Duct_curved_rectangular_complete.FCStd
Binary file not shown.
Binary file modified HVAC/Ducts/Rectangular/Duct_linear_rectangular_complete.FCStd
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.