From d77bc6bdaaeb5e3fd9a9e2b2103c953a61a86be3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 25 Mar 2021 10:48:31 +1100 Subject: [PATCH] First attempt at ripping out agnostic code into ifcopenshell.api namespace. See #1399. --- .../blenderbim/bim/export_ifc.py | 1 + .../blenderbim/bim/handler.py | 4 +- .../blenderbim/bim/import_ifc.py | 1 - .../bim/module/aggregate/operator.py | 6 +-- .../blenderbim/bim/module/aggregate/ui.py | 6 +-- .../bim/module/attribute/operator.py | 6 +-- .../blenderbim/bim/module/attribute/prop.py | 1 - .../blenderbim/bim/module/attribute/ui.py | 5 +- .../blenderbim/bim/module/clash/prop.py | 1 - .../bim/module/classification/operator.py | 30 +++++------ .../bim/module/classification/prop.py | 2 +- .../bim/module/classification/ui.py | 8 +-- .../bim/module/constraint/operator.py | 22 ++++---- .../blenderbim/bim/module/constraint/ui.py | 8 +-- .../blenderbim/bim/module/context/operator.py | 10 ++-- .../blenderbim/bim/module/context/ui.py | 4 +- .../bim/module/document/operator.py | 30 +++++------ .../blenderbim/bim/module/document/ui.py | 8 +-- .../blenderbim/bim/module/drawing/operator.py | 4 +- .../bim/module/geometry/operator.py | 39 +++++++-------- .../blenderbim/bim/module/geometry/ui.py | 4 +- .../bim/module/georeference/operator.py | 18 +++---- .../blenderbim/bim/module/georeference/ui.py | 4 +- .../blenderbim/bim/module/group/operator.py | 22 ++++---- .../blenderbim/bim/module/group/ui.py | 4 +- .../blenderbim/bim/module/layer/operator.py | 22 ++++---- .../blenderbim/bim/module/layer/ui.py | 4 +- .../bim/module/material/operator.py | 42 ++++++++-------- .../blenderbim/bim/module/material/prop.py | 2 +- .../blenderbim/bim/module/material/ui.py | 6 +-- .../blenderbim/bim/module/model/grid.py | 4 +- .../blenderbim/bim/module/owner/operator.py | 50 +++++++++---------- .../blenderbim/bim/module/owner/prop.py | 6 +-- .../blenderbim/bim/module/owner/ui.py | 8 +-- .../blenderbim/bim/module/project/operator.py | 4 +- .../blenderbim/bim/module/pset/operator.py | 20 ++++---- .../blenderbim/bim/module/pset/prop.py | 2 +- .../blenderbim/bim/module/pset/ui.py | 14 +++--- .../bim/module/pset_template/operator.py | 26 +++++----- .../bim/module/pset_template/prop.py | 4 +- .../blenderbim/bim/module/pset_template/ui.py | 5 +- .../blenderbim/bim/module/qto/prop.py | 1 - .../blenderbim/bim/module/root/operator.py | 17 ++----- .../bim/module/root/remove_product.py | 11 ---- .../blenderbim/bim/module/root/ui.py | 4 +- .../bim/module/sequence/operator.py | 2 +- .../blenderbim/bim/module/sequence/ui.py | 4 +- .../blenderbim/bim/module/spatial/operator.py | 10 ++-- .../blenderbim/bim/module/spatial/prop.py | 4 +- .../blenderbim/bim/module/spatial/ui.py | 7 +-- .../bim/module/structural/operator.py | 34 ++++++------- .../blenderbim/bim/module/structural/ui.py | 8 +-- .../blenderbim/bim/module/style/operator.py | 4 +- .../blenderbim/bim/module/type/operator.py | 12 ++--- .../blenderbim/bim/module/type/ui.py | 7 +-- .../blenderbim/bim/module/unit/operator.py | 6 +-- .../blenderbim/bim/module/void/operator.py | 22 ++++---- .../blenderbim/bim/module/void/ui.py | 4 +- src/ifcblenderexport/blenderbim/bim/prop.py | 4 +- .../api}/aggregate/assign_object.py | 4 +- .../ifcopenshell/api}/aggregate/data.py | 6 +-- .../ifcopenshell/api}/attribute/data.py | 7 ++- .../api}/attribute/edit_attributes.py | 2 +- .../api}/classification/add_classification.py | 0 .../api}/classification/add_reference.py | 0 .../ifcopenshell/api}/classification/data.py | 5 +- .../classification/edit_classification.py | 0 .../api}/classification/edit_reference.py | 0 .../classification/remove_classification.py | 0 .../api}/classification/remove_reference.py | 0 .../api}/constraint/add_objective.py | 0 .../api}/constraint/assign_constraint.py | 0 .../ifcopenshell/api}/constraint/data.py | 5 +- .../api}/constraint/edit_objective.py | 0 .../api}/constraint/remove_constraint.py | 0 .../api}/constraint/unassign_constraint.py | 0 .../ifcopenshell/api}/context/add_context.py | 0 .../ifcopenshell/api}/context/data.py | 6 +-- .../api}/context/remove_context.py | 0 .../api}/document/add_information.py | 0 .../api}/document/add_reference.py | 0 .../api}/document/assign_document.py | 0 .../ifcopenshell/api}/document/data.py | 5 +- .../api}/document/edit_information.py | 0 .../api}/document/edit_reference.py | 0 .../api}/document/remove_document.py | 0 .../api}/document/unassign_document.py | 0 .../api}/geometry/add_representation.py | 0 .../api}/geometry/assign_representation.py | 0 .../api}/geometry/assign_styles.py | 0 .../ifcopenshell/api}/geometry/data.py | 6 +-- .../api}/geometry/edit_object_placement.py | 0 .../api}/geometry/map_representation.py | 0 .../api}/geometry/remove_representation.py | 0 .../api}/geometry/unassign_representation.py | 2 +- .../api}/georeference/add_georeferencing.py | 0 .../ifcopenshell/api}/georeference/data.py | 6 +-- .../api}/georeference/edit_georeferencing.py | 0 .../georeference/remove_georeferencing.py | 0 .../api}/grid/create_axis_curve.py | 0 .../api}/grid/create_grid_axis.py | 0 .../ifcopenshell/api}/group/add_group.py | 2 +- .../ifcopenshell/api}/group/assign_group.py | 4 +- .../ifcopenshell/api}/group/data.py | 7 +-- .../ifcopenshell/api}/group/edit_group.py | 0 .../ifcopenshell/api}/group/remove_group.py | 0 .../ifcopenshell/api}/group/unassign_group.py | 2 +- .../ifcopenshell/api}/layer/add_layer.py | 0 .../ifcopenshell/api}/layer/assign_layer.py | 0 .../ifcopenshell/api}/layer/data.py | 5 +- .../ifcopenshell/api}/layer/edit_layer.py | 0 .../ifcopenshell/api}/layer/remove_layer.py | 0 .../ifcopenshell/api}/layer/unassign_layer.py | 0 .../api}/material/add_constituent.py | 0 .../ifcopenshell/api}/material/add_layer.py | 0 .../api}/material/add_list_item.py | 0 .../api}/material/add_material.py | 0 .../api}/material/assign_material.py | 0 .../ifcopenshell/api}/material/data.py | 5 +- .../api}/material/edit_assigned_material.py | 0 .../api}/material/edit_constituent.py | 0 .../ifcopenshell/api}/material/edit_layer.py | 0 .../api}/material/edit_profile.py | 0 .../api}/material/remove_constituent.py | 0 .../api}/material/remove_layer.py | 0 .../api}/material/remove_list_item.py | 0 .../api}/material/remove_material.py | 0 .../api}/material/reorder_set_item.py | 0 .../api}/material/unassign_material.py | 0 .../ifcopenshell/api}/owner/add_address.py | 0 .../api}/owner/add_organisation.py | 0 .../ifcopenshell/api}/owner/add_person.py | 0 .../ifcopenshell/api}/owner/add_role.py | 0 .../ifcopenshell/api}/owner/api.py | 4 +- .../api}/owner/create_owner_history.py | 0 .../ifcopenshell/api}/owner/data.py | 6 +-- .../ifcopenshell/api}/owner/edit_address.py | 0 .../api}/owner/edit_organisation.py | 0 .../ifcopenshell/api}/owner/edit_person.py | 0 .../ifcopenshell/api}/owner/edit_role.py | 0 .../ifcopenshell/api}/owner/remove_address.py | 0 .../api}/owner/remove_organisation.py | 0 .../ifcopenshell/api}/owner/remove_person.py | 0 .../ifcopenshell/api}/owner/remove_role.py | 0 .../api}/owner/update_owner_history.py | 0 .../ifcopenshell/api}/project/create_file.py | 0 .../ifcopenshell/api}/pset/add_pset.py | 0 .../ifcopenshell/api}/pset/add_qto.py | 0 .../ifcopenshell/api}/pset/data.py | 8 +-- .../ifcopenshell/api}/pset/edit_pset.py | 0 .../ifcopenshell/api}/pset/edit_qto.py | 0 .../ifcopenshell/api}/pset/remove_pset.py | 0 .../api}/pset_template/add_prop_template.py | 0 .../api}/pset_template/add_pset_template.py | 0 .../ifcopenshell/api}/pset_template/data.py | 7 +-- .../api}/pset_template/edit_prop_template.py | 0 .../api}/pset_template/edit_pset_template.py | 0 .../pset_template/remove_prop_template.py | 0 .../pset_template/remove_pset_template.py | 0 .../ifcopenshell/api}/root/copy_class.py | 0 .../ifcopenshell/api}/root/create_product.py | 2 +- .../ifcopenshell/api}/root/data.py | 6 +-- .../ifcopenshell/api}/root/reassign_class.py | 0 .../ifcopenshell/api/root/remove_product.py | 27 ++++++++++ .../ifcopenshell/api}/sequence/data.py | 7 +-- .../api}/spatial/assign_container.py | 0 .../ifcopenshell/api}/spatial/data.py | 15 ++---- .../api}/spatial/remove_container.py | 0 .../add_structural_analysis_model.py | 2 +- .../add_structural_boundary_condition.py | 0 .../assign_structural_analysis_model.py | 4 +- .../ifcopenshell/api}/structural/data.py | 10 ++-- .../edit_structural_analysis_model.py | 0 .../edit_structural_boundary_condition.py | 0 .../remove_structural_analysis_model.py | 0 .../remove_structural_boundary_condition.py | 0 .../unassign_structural_analysis_model.py | 2 +- .../ifcopenshell/api}/style/add_style.py | 0 .../ifcopenshell/api}/style/edit_style.py | 0 .../ifcopenshell/api}/type/assign_type.py | 0 .../ifcopenshell/api}/type/data.py | 6 +-- .../api}/type/get_related_objects.py | 0 .../ifcopenshell/api}/type/unassign_type.py | 0 .../ifcopenshell/api}/unit/assign_unit.py | 0 .../ifcopenshell/api}/unit/data.py | 6 +-- .../ifcopenshell/api}/void/add_filling.py | 0 .../ifcopenshell/api}/void/add_opening.py | 0 .../ifcopenshell/api}/void/data.py | 6 +-- .../ifcopenshell/api}/void/remove_filling.py | 0 .../ifcopenshell/api}/void/remove_opening.py | 0 190 files changed, 388 insertions(+), 437 deletions(-) delete mode 100644 src/ifcblenderexport/blenderbim/bim/module/root/remove_product.py rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/aggregate/assign_object.py (93%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/aggregate/data.py (82%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/attribute/data.py (88%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/attribute/edit_attributes.py (89%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/add_classification.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/add_reference.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/data.py (95%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/edit_classification.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/edit_reference.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/remove_classification.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/classification/remove_reference.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/add_objective.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/assign_constraint.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/data.py (92%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/edit_objective.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/remove_constraint.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/constraint/unassign_constraint.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/context/add_context.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/context/data.py (89%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/context/remove_context.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/add_information.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/add_reference.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/assign_document.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/data.py (95%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/edit_information.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/edit_reference.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/remove_document.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/document/unassign_document.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/add_representation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/assign_representation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/assign_styles.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/data.py (92%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/edit_object_placement.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/map_representation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/remove_representation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/geometry/unassign_representation.py (97%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/georeference/add_georeferencing.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/georeference/data.py (91%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/georeference/edit_georeferencing.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/georeference/remove_georeferencing.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/grid/create_axis_curve.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/grid/create_grid_axis.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/add_group.py (87%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/assign_group.py (87%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/data.py (80%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/edit_group.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/remove_group.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/group/unassign_group.py (91%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/add_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/assign_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/data.py (89%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/edit_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/remove_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/layer/unassign_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/add_constituent.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/add_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/add_list_item.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/add_material.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/assign_material.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/data.py (96%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/edit_assigned_material.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/edit_constituent.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/edit_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/edit_profile.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/remove_constituent.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/remove_layer.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/remove_list_item.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/remove_material.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/reorder_set_item.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/material/unassign_material.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/add_address.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/add_organisation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/add_person.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/add_role.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/api.py (91%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/create_owner_history.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/data.py (95%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/edit_address.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/edit_organisation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/edit_person.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/edit_role.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/remove_address.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/remove_organisation.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/remove_person.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/remove_role.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/owner/update_owner_history.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/project/create_file.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/add_pset.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/add_qto.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/data.py (96%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/edit_pset.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/edit_qto.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset/remove_pset.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/add_prop_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/add_pset_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/data.py (90%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/edit_prop_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/edit_pset_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/remove_prop_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/pset_template/remove_pset_template.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/root/copy_class.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/root/create_product.py (94%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/root/data.py (81%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/root/reassign_class.py (100%) create mode 100644 src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/sequence/data.py (71%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/spatial/assign_container.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/spatial/data.py (83%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/spatial/remove_container.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/add_structural_analysis_model.py (88%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/add_structural_boundary_condition.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/assign_structural_analysis_model.py (88%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/data.py (90%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/edit_structural_analysis_model.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/edit_structural_boundary_condition.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/remove_structural_analysis_model.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/remove_structural_boundary_condition.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/structural/unassign_structural_analysis_model.py (92%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/style/add_style.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/style/edit_style.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/type/assign_type.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/type/data.py (91%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/type/get_related_objects.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/type/unassign_type.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/unit/assign_unit.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/unit/data.py (82%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/void/add_filling.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/void/add_opening.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/void/data.py (95%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/void/remove_filling.py (100%) rename src/{ifcblenderexport/blenderbim/bim/module => ifcopenshell-python/ifcopenshell/api}/void/remove_opening.py (100%) diff --git a/src/ifcblenderexport/blenderbim/bim/export_ifc.py b/src/ifcblenderexport/blenderbim/bim/export_ifc.py index 7134b013c5..d101da7759 100644 --- a/src/ifcblenderexport/blenderbim/bim/export_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/export_ifc.py @@ -7,6 +7,7 @@ import zipfile import tempfile import ifcopenshell import ifcopenshell.util.placement +import ifcopenshell.api.root.remove_product as remove_product from blenderbim.bim.ifc import IfcStore import addon_utils diff --git a/src/ifcblenderexport/blenderbim/bim/handler.py b/src/ifcblenderexport/blenderbim/bim/handler.py index a54440a62f..ad9e940872 100644 --- a/src/ifcblenderexport/blenderbim/bim/handler.py +++ b/src/ifcblenderexport/blenderbim/bim/handler.py @@ -3,7 +3,7 @@ import json import blenderbim.bim.decoration as decoration from bpy.app.handlers import persistent from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.attribute.data import Data as AttributeData +from ifcopenshell.api.attribute.data import Data as AttributeData def mode_callback(obj, data): @@ -28,7 +28,7 @@ def name_callback(obj, data): if not element.is_a("IfcRoot"): return element.Name = "/".join(obj.name.split("/")[1:]) - AttributeData.load(obj.BIMObjectProperties.ifc_definition_id) + AttributeData.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) def subscribe_to(object, data_path, callback): diff --git a/src/ifcblenderexport/blenderbim/bim/import_ifc.py b/src/ifcblenderexport/blenderbim/bim/import_ifc.py index b546d9c088..27de5fe16c 100644 --- a/src/ifcblenderexport/blenderbim/bim/import_ifc.py +++ b/src/ifcblenderexport/blenderbim/bim/import_ifc.py @@ -21,7 +21,6 @@ import numpy as np from pathlib import Path from itertools import cycle from datetime import datetime -from blenderbim.bim.module.context.data import Data as ContextData from blenderbim.bim.ifc import IfcStore from . import schema diff --git a/src/ifcblenderexport/blenderbim/bim/module/aggregate/operator.py b/src/ifcblenderexport/blenderbim/bim/module/aggregate/operator.py index 4c546a61bf..c734e4428a 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/aggregate/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/aggregate/operator.py @@ -1,7 +1,7 @@ import bpy -import blenderbim.bim.module.aggregate.assign_object as assign_object +import ifcopenshell.api.aggregate.assign_object as assign_object from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.aggregate.data import Data +from ifcopenshell.api.aggregate.data import Data class AssignObject(bpy.types.Operator): @@ -26,7 +26,7 @@ class AssignObject(bpy.types.Operator): }, ).execute() bpy.ops.bim.edit_object_placement(obj=related_object.name) - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) bpy.ops.bim.disable_editing_aggregate(obj=related_object.name) spatial_collection = bpy.data.collections.get(related_object.name) diff --git a/src/ifcblenderexport/blenderbim/bim/module/aggregate/ui.py b/src/ifcblenderexport/blenderbim/bim/module/aggregate/ui.py index 6749a6b567..744e369350 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/aggregate/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/aggregate/ui.py @@ -1,5 +1,5 @@ from bpy.types import Panel -from blenderbim.bim.module.aggregate.data import Data +from ifcopenshell.api.aggregate.data import Data from blenderbim.bim.ifc import IfcStore @@ -19,7 +19,7 @@ class BIM_PT_aggregate(Panel): if not IfcStore.get_file().by_id(props.ifc_definition_id).is_a("IfcObjectDefinition"): return False if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if not Data.products[props.ifc_definition_id]: return False return True @@ -29,7 +29,7 @@ class BIM_PT_aggregate(Panel): if not props.ifc_definition_id: return if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if props.is_editing_aggregate: row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/attribute/operator.py b/src/ifcblenderexport/blenderbim/bim/module/attribute/operator.py index 531c5a6797..65a5f305ce 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/attribute/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/attribute/operator.py @@ -1,9 +1,9 @@ import bpy import json import ifcopenshell -import blenderbim.bim.module.attribute.edit_attributes as edit_attributes +import ifcopenshell.api.attribute.edit_attributes as edit_attributes from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.attribute.data import Data +from ifcopenshell.api.attribute.data import Data class EnableEditingAttributes(bpy.types.Operator): @@ -105,7 +105,7 @@ class EditAttributes(bpy.types.Operator): if collection: collection.name = new_name obj.name = new_name - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) bpy.ops.bim.disable_editing_attributes(obj=obj.name, obj_type=self.obj_type) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/attribute/prop.py b/src/ifcblenderexport/blenderbim/bim/module/attribute/prop.py index 8e57d7af72..4b95bf1865 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/attribute/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/attribute/prop.py @@ -1,6 +1,5 @@ import bpy import blenderbim.bim.schema # refactor -from blenderbim.bim.module.material.data import Data from blenderbim.bim.ifc import IfcStore from blenderbim.bim.prop import StrProperty, Attribute from bpy.types import PropertyGroup diff --git a/src/ifcblenderexport/blenderbim/bim/module/attribute/ui.py b/src/ifcblenderexport/blenderbim/bim/module/attribute/ui.py index 0856d8bfdc..1d345d0fa2 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/attribute/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/attribute/ui.py @@ -1,5 +1,6 @@ from bpy.types import Panel -from blenderbim.bim.module.attribute.data import Data +from blenderbim.bim.ifc import IfcStore +from ifcopenshell.api.attribute.data import Data def draw_ui(context, layout, obj_type): @@ -7,7 +8,7 @@ def draw_ui(context, layout, obj_type): oprops = obj.BIMObjectProperties props = obj.BIMAttributeProperties if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) if props.is_editing_attributes: row = layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/clash/prop.py b/src/ifcblenderexport/blenderbim/bim/module/clash/prop.py index 185e9fe163..ba685b64d3 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/clash/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/clash/prop.py @@ -1,6 +1,5 @@ import bpy from blenderbim.bim.prop import StrProperty, Attribute -from blenderbim.bim.module.owner.data import Data from bpy.types import PropertyGroup from bpy.props import ( PointerProperty, diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/operator.py b/src/ifcblenderexport/blenderbim/bim/module/classification/operator.py index 1150f138f3..8072d8e636 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/classification/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/classification/operator.py @@ -1,13 +1,13 @@ import bpy import json -import blenderbim.bim.module.classification.add_classification as add_classification -import blenderbim.bim.module.classification.remove_classification as remove_classification -import blenderbim.bim.module.classification.edit_classification as edit_classification -import blenderbim.bim.module.classification.add_reference as add_reference -import blenderbim.bim.module.classification.remove_reference as remove_reference -import blenderbim.bim.module.classification.edit_reference as edit_reference +import ifcopenshell.api.classification.add_classification as add_classification +import ifcopenshell.api.classification.remove_classification as remove_classification +import ifcopenshell.api.classification.edit_classification as edit_classification +import ifcopenshell.api.classification.add_reference as add_reference +import ifcopenshell.api.classification.remove_reference as remove_reference +import ifcopenshell.api.classification.edit_reference as edit_reference from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.classification.data import Data +from ifcopenshell.api.classification.data import Data from blenderbim.bim.module.classification.prop import getClassifications, getReferences @@ -37,7 +37,7 @@ class AddClassification(bpy.types.Operator): add_classification.Usecase( IfcStore.get_file(), {"classification": Data.library_file.by_id(int(props.available_classifications))} ).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -81,7 +81,7 @@ class RemoveClassification(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() remove_classification.Usecase(self.file, {"classification": self.file.by_id(self.classification)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -103,7 +103,7 @@ class EditClassification(bpy.types.Operator): edit_classification.Usecase( self.file, {"classification": self.file.by_id(props.active_classification_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_classification() return {"FINISHED"} @@ -159,8 +159,8 @@ class RemoveClassificationReference(bpy.types.Operator): "product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id), }, ).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) - Data.load() + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -182,7 +182,7 @@ class EditClassificationReference(bpy.types.Operator): edit_reference.Usecase( self.file, {"reference": self.file.by_id(props.active_reference_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_classification_reference() return {"FINISHED"} @@ -214,8 +214,8 @@ class AddClassificationReference(bpy.types.Operator): "classification": classification }, ).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) - Data.load() + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/prop.py b/src/ifcblenderexport/blenderbim/bim/module/classification/prop.py index 3793b29ec3..85ffb7ce8b 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/classification/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/classification/prop.py @@ -1,6 +1,6 @@ import bpy from blenderbim.bim.prop import StrProperty, Attribute -from blenderbim.bim.module.classification.data import Data +from ifcopenshell.api.classification.data import Data from bpy.types import PropertyGroup from bpy.props import ( PointerProperty, diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/ui.py b/src/ifcblenderexport/blenderbim/bim/module/classification/ui.py index 122201c8e9..d0b65021a8 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/classification/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/classification/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.classification.data import Data +from ifcopenshell.api.classification.data import Data class BIM_PT_classifications(Panel): @@ -17,7 +17,7 @@ class BIM_PT_classifications(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMClassificationProperties @@ -79,9 +79,9 @@ class BIM_PT_classification_references(Panel): self.props = obj.BIMClassificationReferenceProperties self.file = IfcStore.get_file() if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) if self.oprops.ifc_definition_id not in Data.products: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.draw_add_ui() diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/operator.py b/src/ifcblenderexport/blenderbim/bim/module/constraint/operator.py index 0bbcdc5f54..a065ae822c 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/constraint/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/constraint/operator.py @@ -1,13 +1,13 @@ import bpy import json import ifcopenshell.util.attribute -import blenderbim.bim.module.constraint.add_objective as add_objective -import blenderbim.bim.module.constraint.edit_objective as edit_objective -import blenderbim.bim.module.constraint.remove_constraint as remove_constraint -import blenderbim.bim.module.constraint.assign_constraint as assign_constraint -import blenderbim.bim.module.constraint.unassign_constraint as unassign_constraint +import ifcopenshell.api.constraint.add_objective as add_objective +import ifcopenshell.api.constraint.edit_objective as edit_objective +import ifcopenshell.api.constraint.remove_constraint as remove_constraint +import ifcopenshell.api.constraint.assign_constraint as assign_constraint +import ifcopenshell.api.constraint.unassign_constraint as unassign_constraint from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.constraint.data import Data +from ifcopenshell.api.constraint.data import Data class LoadObjectives(bpy.types.Operator): @@ -84,7 +84,7 @@ class AddObjective(bpy.types.Operator): def execute(self, context): result = add_objective.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_objectives() bpy.ops.bim.enable_editing_constraint(constraint=result.id()) return {"FINISHED"} @@ -108,7 +108,7 @@ class EditObjective(bpy.types.Operator): edit_objective.Usecase( self.file, {"objective": self.file.by_id(props.active_constraint_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_objectives() return {"FINISHED"} @@ -122,7 +122,7 @@ class RemoveConstraint(bpy.types.Operator): props = context.scene.BIMConstraintProperties self.file = IfcStore.get_file() remove_constraint.Usecase(self.file, {"constraint": self.file.by_id(self.constraint)}).execute() - Data.load() + Data.load(IfcStore.get_file()) if props.is_editing == "IfcObjective": bpy.ops.bim.load_objectives() return {"FINISHED"} @@ -167,7 +167,7 @@ class AssignConstraint(bpy.types.Operator): "product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id), "constraint": self.file.by_id(self.constraint) }).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -184,5 +184,5 @@ class UnassignConstraint(bpy.types.Operator): "product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id), "constraint": self.file.by_id(self.constraint) }).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/ui.py b/src/ifcblenderexport/blenderbim/bim/module/constraint/ui.py index 329a203779..c6132dc43d 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/constraint/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/constraint/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.constraint.data import Data +from ifcopenshell.api.constraint.data import Data class BIM_PT_constraints(Panel): @@ -17,7 +17,7 @@ class BIM_PT_constraints(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMConstraintProperties @@ -73,9 +73,9 @@ class BIM_PT_object_constraints(Panel): self.props = obj.BIMObjectConstraintProperties self.file = IfcStore.get_file() if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) if self.oprops.ifc_definition_id not in Data.products: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.draw_add_ui() diff --git a/src/ifcblenderexport/blenderbim/bim/module/context/operator.py b/src/ifcblenderexport/blenderbim/bim/module/context/operator.py index 2fbdb94157..1ad083a2ae 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/context/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/context/operator.py @@ -1,8 +1,8 @@ import bpy -import blenderbim.bim.module.context.add_context as add_context -import blenderbim.bim.module.context.remove_context as remove_context +import ifcopenshell.api.context.add_context as add_context +import ifcopenshell.api.context.remove_context as remove_context from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.context.data import Data +from ifcopenshell.api.context.data import Data class AddSubcontext(bpy.types.Operator): @@ -22,7 +22,7 @@ class AddSubcontext(bpy.types.Operator): "target_view": self.target_view or bpy.context.scene.BIMProperties.available_target_views, }, ).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -35,5 +35,5 @@ class RemoveSubcontext(bpy.types.Operator): self.file = IfcStore.get_file() usecase = remove_context.Usecase(self.file, {"context": self.file.by_id(self.ifc_definition_id)}) usecase.execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/context/ui.py b/src/ifcblenderexport/blenderbim/bim/module/context/ui.py index 07182ab2ac..2573cfa80f 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/context/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/context/ui.py @@ -1,5 +1,5 @@ from bpy.types import Panel -from blenderbim.bim.module.context.data import Data +from ifcopenshell.api.context.data import Data from blenderbim.bim.ifc import IfcStore @@ -17,7 +17,7 @@ class BIM_PT_context(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) props = context.scene.BIMProperties diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/operator.py b/src/ifcblenderexport/blenderbim/bim/module/document/operator.py index f6e4e46714..6baae5c34c 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/document/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/document/operator.py @@ -1,15 +1,15 @@ import bpy import json import ifcopenshell.util.attribute -import blenderbim.bim.module.document.add_information as add_information -import blenderbim.bim.module.document.add_reference as add_reference -import blenderbim.bim.module.document.edit_information as edit_information -import blenderbim.bim.module.document.edit_reference as edit_reference -import blenderbim.bim.module.document.remove_document as remove_document -import blenderbim.bim.module.document.assign_document as assign_document -import blenderbim.bim.module.document.unassign_document as unassign_document +import ifcopenshell.api.document.add_information as add_information +import ifcopenshell.api.document.add_reference as add_reference +import ifcopenshell.api.document.edit_information as edit_information +import ifcopenshell.api.document.edit_reference as edit_reference +import ifcopenshell.api.document.remove_document as remove_document +import ifcopenshell.api.document.assign_document as assign_document +import ifcopenshell.api.document.unassign_document as unassign_document from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.document.data import Data +from ifcopenshell.api.document.data import Data class LoadInformation(bpy.types.Operator): @@ -117,7 +117,7 @@ class AddInformation(bpy.types.Operator): def execute(self, context): result = add_information.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_information() bpy.ops.bim.enable_editing_document(document=result.id()) return {"FINISHED"} @@ -129,7 +129,7 @@ class AddDocumentReference(bpy.types.Operator): def execute(self, context): result = add_reference.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_document_references() bpy.ops.bim.enable_editing_document(document=result.id()) return {"FINISHED"} @@ -153,7 +153,7 @@ class EditInformation(bpy.types.Operator): edit_information.Usecase( self.file, {"information": self.file.by_id(props.active_document_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_information() return {"FINISHED"} @@ -174,7 +174,7 @@ class EditDocumentReference(bpy.types.Operator): edit_reference.Usecase( self.file, {"reference": self.file.by_id(props.active_document_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_document_references() return {"FINISHED"} @@ -188,7 +188,7 @@ class RemoveDocument(bpy.types.Operator): props = context.scene.BIMDocumentProperties self.file = IfcStore.get_file() remove_document.Usecase(self.file, {"document": self.file.by_id(self.document)}).execute() - Data.load() + Data.load(IfcStore.get_file()) if props.is_editing == "information": bpy.ops.bim.load_information() elif props.is_editing == "reference": @@ -237,7 +237,7 @@ class AssignDocument(bpy.types.Operator): "product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id), "document": self.file.by_id(self.document) }).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -254,5 +254,5 @@ class UnassignDocument(bpy.types.Operator): "product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id), "document": self.file.by_id(self.document) }).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/ui.py b/src/ifcblenderexport/blenderbim/bim/module/document/ui.py index d1e713902d..1893fb620e 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/document/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/document/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.document.data import Data +from ifcopenshell.api.document.data import Data class BIM_PT_documents(Panel): @@ -17,7 +17,7 @@ class BIM_PT_documents(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMDocumentProperties @@ -77,9 +77,9 @@ class BIM_PT_object_documents(Panel): self.props = obj.BIMObjectDocumentProperties self.file = IfcStore.get_file() if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) if self.oprops.ifc_definition_id not in Data.products: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.draw_add_ui() diff --git a/src/ifcblenderexport/blenderbim/bim/module/drawing/operator.py b/src/ifcblenderexport/blenderbim/bim/module/drawing/operator.py index 72b3f7ccc8..909f654996 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/drawing/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/drawing/operator.py @@ -5,8 +5,8 @@ import subprocess import webbrowser from blenderbim.bim.operator import open_with_user_command from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.group.data import Data as GroupData -from blenderbim.bim.module.pset.data import Data as PsetData +from ifcopenshell.api.group.data import Data as GroupData +from ifcopenshell.api.pset.data import Data as PsetData cwd = os.path.dirname(os.path.realpath(__file__)) diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/operator.py b/src/ifcblenderexport/blenderbim/bim/module/geometry/operator.py index 6119164df7..ac86de2539 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/geometry/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/geometry/operator.py @@ -4,19 +4,19 @@ import ifcopenshell import ifcopenshell.util.unit import ifcopenshell.util.element import logging -import blenderbim.bim.module.geometry.edit_object_placement as edit_object_placement -import blenderbim.bim.module.geometry.add_representation as add_representation -import blenderbim.bim.module.geometry.map_representation as map_representation -import blenderbim.bim.module.geometry.assign_styles as assign_styles -import blenderbim.bim.module.geometry.assign_representation as assign_representation -import blenderbim.bim.module.geometry.unassign_representation as unassign_representation -import blenderbim.bim.module.geometry.remove_representation as remove_representation -import blenderbim.bim.module.grid.create_axis_curve as create_axis_curve +import ifcopenshell.api.geometry.edit_object_placement as edit_object_placement +import ifcopenshell.api.geometry.add_representation as add_representation +import ifcopenshell.api.geometry.map_representation as map_representation +import ifcopenshell.api.geometry.assign_styles as assign_styles +import ifcopenshell.api.geometry.assign_representation as assign_representation +import ifcopenshell.api.geometry.unassign_representation as unassign_representation +import ifcopenshell.api.geometry.remove_representation as remove_representation +import ifcopenshell.api.grid.create_axis_curve as create_axis_curve from blenderbim.bim.ifc import IfcStore from blenderbim.bim import import_ifc -from blenderbim.bim.module.geometry.data import Data -from blenderbim.bim.module.context.data import Data as ContextData -from blenderbim.bim.module.void.data import Data as VoidData +from ifcopenshell.api.geometry.data import Data +from ifcopenshell.api.context.data import Data as ContextData +from ifcopenshell.api.void.data import Data as VoidData from mathutils import Vector @@ -139,7 +139,7 @@ class AddRepresentation(bpy.types.Operator): mesh.name = "{}/{}".format(context_id, result.id()) mesh.BIMMeshProperties.ifc_definition_id = int(result.id()) obj.data = mesh - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -190,7 +190,7 @@ class SwitchRepresentation(bpy.types.Operator): if self.disable_opening_subtractions and self.context_of_items.ContextIdentifier == "Body": if self.oprops.ifc_definition_id not in VoidData.products: - VoidData.load(self.oprops.ifc_definition_id) + VoidData.load(IfcStore.get_file(), self.oprops.ifc_definition_id) for opening_id in VoidData.products[self.oprops.ifc_definition_id]: if opening_id in IfcStore.id_map: opening = IfcStore.id_map[opening_id] @@ -213,7 +213,6 @@ class RemoveRepresentation(bpy.types.Operator): self.file = IfcStore.get_file() representation = self.file.by_id(self.representation_id) obj = bpy.data.objects.get(self.obj) if self.obj else bpy.context.active_object - product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id) is_mapped_representation = representation.RepresentationType == "MappedRepresentation" if is_mapped_representation: mesh_name = "{}/{}".format( @@ -234,7 +233,7 @@ class RemoveRepresentation(bpy.types.Operator): product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id) unassign_representation.Usecase(self.file, {"product": product, "representation": representation}).execute() remove_representation.Usecase(self.file, {"representation": representation}).execute() - Data.load(product.id()) + Data.load(IfcStore.get_file(), product.id()) return {"FINISHED"} @@ -248,13 +247,13 @@ class MapRepresentations(bpy.types.Operator): related_object = IfcStore.id_map[self.product_id] if self.product_id not in Data.products: - Data.load(self.product_id) + Data.load(IfcStore.get_file(), self.product_id) for representation_id in Data.products[self.product_id]: bpy.ops.bim.remove_representation(obj=related_object.name, representation_id=representation_id) if self.type_product_id not in Data.products: - Data.load(self.type_product_id) + Data.load(IfcStore.get_file(), self.type_product_id) for representation_id in Data.products[self.type_product_id]: bpy.ops.bim.map_representation( @@ -287,7 +286,7 @@ class MapRepresentation(bpy.types.Operator): self.file, {"representation": self.file.by_id(self.representation_id)} ).execute() assign_representation.Usecase(self.file, {"product": product, "representation": result}).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -299,7 +298,7 @@ class UpdateMeshRepresentation(bpy.types.Operator): def execute(self, context): if not ContextData.is_loaded: - ContextData.load() + ContextData.load(IfcStore.get_file()) objs = [bpy.data.objects.get(self.obj)] if self.obj else bpy.context.selected_objects self.file = IfcStore.get_file() @@ -396,7 +395,7 @@ class UpdateMeshRepresentation(bpy.types.Operator): obj.data.BIMMeshProperties.ifc_definition_id = int(new_representation.id()) obj.data.name = f"{old_representation.ContextOfItems.id()}/{new_representation.id()}" bpy.ops.bim.remove_representation(representation_id=old_representation.id()) - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) class UpdateParametricRepresentation(bpy.types.Operator): diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/ui.py b/src/ifcblenderexport/blenderbim/bim/module/geometry/ui.py index 99e1c482cf..b07a8d1f82 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/geometry/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/geometry/ui.py @@ -1,6 +1,6 @@ import bpy from bpy.types import Panel -from blenderbim.bim.module.geometry.data import Data +from ifcopenshell.api.geometry.data import Data from blenderbim.bim.ifc import IfcStore @@ -21,7 +21,7 @@ class BIM_PT_representations(Panel): props = context.active_object.BIMObjectProperties if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) representations = Data.products[props.ifc_definition_id] if not representations: diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/operator.py b/src/ifcblenderexport/blenderbim/bim/module/georeference/operator.py index 252a08e189..fe6a183340 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/georeference/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/georeference/operator.py @@ -3,11 +3,11 @@ import json import ifcopenshell import ifcopenshell.util.unit import ifcopenshell.util.attribute -import blenderbim.bim.module.georeference.add_georeferencing as add_georeferencing -import blenderbim.bim.module.georeference.edit_georeferencing as edit_georeferencing -import blenderbim.bim.module.georeference.remove_georeferencing as remove_georeferencing +import ifcopenshell.api.georeference.add_georeferencing as add_georeferencing +import ifcopenshell.api.georeference.edit_georeferencing as edit_georeferencing +import ifcopenshell.api.georeference.remove_georeferencing as remove_georeferencing from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.georeference.data import Data +from ifcopenshell.api.georeference.data import Data from math import radians, degrees, atan, tan, cos, sin @@ -134,7 +134,7 @@ class EditGeoreferencing(bpy.types.Operator): edit_georeferencing.Usecase( self.file, {"map_conversion": map_conversion, "projected_crs": projected_crs, "map_unit": map_unit} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_georeferencing() return {"FINISHED"} @@ -170,7 +170,7 @@ class RemoveGeoreferencing(bpy.types.Operator): def execute(self, context): remove_georeferencing.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -180,7 +180,7 @@ class AddGeoreferencing(bpy.types.Operator): def execute(self, context): add_georeferencing.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -190,7 +190,7 @@ class ConvertLocalToGlobal(bpy.types.Operator): def execute(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) props = context.scene.BIMGeoreferenceProperties x, y, z = [float(co) for co in props.coordinate_input.split(",")] @@ -240,7 +240,7 @@ class ConvertGlobalToLocal(bpy.types.Operator): def execute(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) props = context.scene.BIMGeoreferenceProperties x, y, z = [float(co) for co in props.coordinate_input.split(",")] diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/ui.py b/src/ifcblenderexport/blenderbim/bim/module/georeference/ui.py index 6c2675d7bd..ddf04c40ff 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/georeference/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/georeference/ui.py @@ -1,5 +1,5 @@ from bpy.types import Panel -from blenderbim.bim.module.georeference.data import Data +from ifcopenshell.api.georeference.data import Data from blenderbim.bim.ifc import IfcStore class BIM_PT_gis(Panel): @@ -17,7 +17,7 @@ class BIM_PT_gis(Panel): def draw(self, context): props = context.scene.BIMGeoreferenceProperties if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) if props.is_editing: return self.draw_editable_ui(context) diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/operator.py b/src/ifcblenderexport/blenderbim/bim/module/group/operator.py index 42f91be230..fe83656187 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/group/operator.py @@ -1,12 +1,12 @@ import bpy import ifcopenshell.util.attribute -import blenderbim.bim.module.group.add_group as add_group -import blenderbim.bim.module.group.edit_group as edit_group -import blenderbim.bim.module.group.remove_group as remove_group -import blenderbim.bim.module.group.assign_group as assign_group -import blenderbim.bim.module.group.unassign_group as unassign_group +import ifcopenshell.api.group.add_group as add_group +import ifcopenshell.api.group.edit_group as edit_group +import ifcopenshell.api.group.remove_group as remove_group +import ifcopenshell.api.group.assign_group as assign_group +import ifcopenshell.api.group.unassign_group as unassign_group from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.group.data import Data +from ifcopenshell.api.group.data import Data class LoadGroups(bpy.types.Operator): @@ -41,7 +41,7 @@ class AddGroup(bpy.types.Operator): def execute(self, context): result = add_group.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_groups() bpy.ops.bim.enable_editing_group(group=result.id()) return {"FINISHED"} @@ -63,7 +63,7 @@ class EditGroup(bpy.types.Operator): edit_group.Usecase( self.file, {"group": self.file.by_id(props.active_group_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_groups() return {"FINISHED"} @@ -77,7 +77,7 @@ class RemoveGroup(bpy.types.Operator): props = context.scene.BIMGroupProperties self.file = IfcStore.get_file() remove_group.Usecase(self.file, {"group": self.file.by_id(self.group)}).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_groups() return {"FINISHED"} @@ -129,7 +129,7 @@ class AssignGroup(bpy.types.Operator): "product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id), "group": self.file.by_id(self.group) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -146,5 +146,5 @@ class UnassignGroup(bpy.types.Operator): "product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id), "group": self.file.by_id(self.group) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/ui.py b/src/ifcblenderexport/blenderbim/bim/module/group/ui.py index 499f67a8b8..21731dc0d0 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/group/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.group.data import Data +from ifcopenshell.api.group.data import Data class BIM_PT_groups(Panel): @@ -17,7 +17,7 @@ class BIM_PT_groups(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMGroupProperties row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/operator.py b/src/ifcblenderexport/blenderbim/bim/module/layer/operator.py index 7b4b3e295f..1042e8b565 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/layer/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/layer/operator.py @@ -1,13 +1,13 @@ import bpy import json import ifcopenshell.util.attribute -import blenderbim.bim.module.layer.add_layer as add_layer -import blenderbim.bim.module.layer.edit_layer as edit_layer -import blenderbim.bim.module.layer.remove_layer as remove_layer -import blenderbim.bim.module.layer.assign_layer as assign_layer -import blenderbim.bim.module.layer.unassign_layer as unassign_layer +import ifcopenshell.api.layer.add_layer as add_layer +import ifcopenshell.api.layer.edit_layer as edit_layer +import ifcopenshell.api.layer.remove_layer as remove_layer +import ifcopenshell.api.layer.assign_layer as assign_layer +import ifcopenshell.api.layer.unassign_layer as unassign_layer from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.layer.data import Data +from ifcopenshell.api.layer.data import Data class LoadLayers(bpy.types.Operator): @@ -77,7 +77,7 @@ class AddPresentationLayer(bpy.types.Operator): def execute(self, context): result = add_layer.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_layers() bpy.ops.bim.enable_editing_layer(layer=result.id()) return {"FINISHED"} @@ -99,7 +99,7 @@ class EditPresentationLayer(bpy.types.Operator): edit_layer.Usecase( self.file, {"layer": self.file.by_id(props.active_layer_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_layers() return {"FINISHED"} @@ -113,7 +113,7 @@ class RemovePresentationLayer(bpy.types.Operator): props = context.scene.BIMLayerProperties self.file = IfcStore.get_file() remove_layer.Usecase(self.file, {"layer": self.file.by_id(self.layer)}).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_layers() return {"FINISHED"} @@ -131,7 +131,7 @@ class AssignPresentationLayer(bpy.types.Operator): "item": self.file.by_id(item.BIMMeshProperties.ifc_definition_id), "layer": self.file.by_id(self.layer) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -148,5 +148,5 @@ class UnassignPresentationLayer(bpy.types.Operator): "item": self.file.by_id(item.BIMMeshProperties.ifc_definition_id), "layer": self.file.by_id(self.layer) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/ui.py b/src/ifcblenderexport/blenderbim/bim/module/layer/ui.py index 3c21e540c5..7ed1cc4da6 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/layer/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/layer/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList, Mesh from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.layer.data import Data +from ifcopenshell.api.layer.data import Data class BIM_PT_layers(Panel): @@ -17,7 +17,7 @@ class BIM_PT_layers(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMLayerProperties diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/operator.py b/src/ifcblenderexport/blenderbim/bim/module/material/operator.py index b784e7610f..7f945f508c 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/material/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/material/operator.py @@ -1,20 +1,20 @@ import bpy import ifcopenshell.util.attribute -import blenderbim.bim.module.material.add_material as add_material -import blenderbim.bim.module.material.remove_material as remove_material -import blenderbim.bim.module.material.assign_material as assign_material -import blenderbim.bim.module.material.unassign_material as unassign_material -import blenderbim.bim.module.material.add_constituent as add_constituent -import blenderbim.bim.module.material.remove_constituent as remove_constituent -import blenderbim.bim.module.material.add_layer as add_layer -import blenderbim.bim.module.material.edit_layer as edit_layer -import blenderbim.bim.module.material.remove_layer as remove_layer -import blenderbim.bim.module.material.reorder_set_item as reorder_set_item -import blenderbim.bim.module.material.add_list_item as add_list_item -import blenderbim.bim.module.material.remove_list_item as remove_list_item -import blenderbim.bim.module.material.edit_assigned_material as edit_assigned_material +import ifcopenshell.api.material.add_material as add_material +import ifcopenshell.api.material.remove_material as remove_material +import ifcopenshell.api.material.assign_material as assign_material +import ifcopenshell.api.material.unassign_material as unassign_material +import ifcopenshell.api.material.add_constituent as add_constituent +import ifcopenshell.api.material.remove_constituent as remove_constituent +import ifcopenshell.api.material.add_layer as add_layer +import ifcopenshell.api.material.edit_layer as edit_layer +import ifcopenshell.api.material.remove_layer as remove_layer +import ifcopenshell.api.material.reorder_set_item as reorder_set_item +import ifcopenshell.api.material.add_list_item as add_list_item +import ifcopenshell.api.material.remove_list_item as remove_list_item +import ifcopenshell.api.material.edit_assigned_material as edit_assigned_material from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.material.data import Data +from ifcopenshell.api.material.data import Data class AddMaterial(bpy.types.Operator): @@ -27,7 +27,7 @@ class AddMaterial(bpy.types.Operator): self.file = IfcStore.get_file() result = add_material.Usecase(self.file, {"Name": obj.name}).execute() obj.BIMObjectProperties.ifc_definition_id = result.id() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -43,7 +43,7 @@ class RemoveMaterial(bpy.types.Operator): self.file, {"material": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)} ).execute() obj.BIMObjectProperties.ifc_definition_id = 0 - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -65,8 +65,8 @@ class AssignMaterial(bpy.types.Operator): "material": self.file.by_id(int(obj.BIMObjectMaterialProperties.material)), }, ).execute() - Data.load() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file()) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -81,7 +81,7 @@ class UnassignMaterial(bpy.types.Operator): unassign_material.Usecase( self.file, {"product": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)} ).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -298,7 +298,7 @@ class EditAssignedMaterial(bpy.types.Operator): if product_data["type"] == "IfcMaterial": bpy.ops.bim.unassign_material(obj=obj.name) bpy.ops.bim.assign_material(obj=obj.name, material_type="IfcMaterial") - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) bpy.ops.bim.disable_editing_assigned_material(obj=obj.name) return {"FINISHED"} @@ -312,7 +312,7 @@ class EditAssignedMaterial(bpy.types.Operator): "attributes": attributes, }, ).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) if material_set.is_a("IfcMaterialConstituentSet"): Data.load_constituents() elif material_set.is_a("IfcMaterialLayerSet"): diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/prop.py b/src/ifcblenderexport/blenderbim/bim/module/material/prop.py index 1e0f93a371..4795832bbc 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/material/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/material/prop.py @@ -1,6 +1,6 @@ import bpy import blenderbim.bim.schema # refactor -from blenderbim.bim.module.material.data import Data +from ifcopenshell.api.material.data import Data from blenderbim.bim.ifc import IfcStore from blenderbim.bim.prop import StrProperty, Attribute from bpy.types import PropertyGroup diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/ui.py b/src/ifcblenderexport/blenderbim/bim/module/material/ui.py index 60b2cec9da..6d432f673a 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/material/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/material/ui.py @@ -1,5 +1,5 @@ from bpy.types import Panel -from blenderbim.bim.module.material.data import Data +from ifcopenshell.api.material.data import Data from blenderbim.bim.ifc import IfcStore @@ -43,9 +43,9 @@ class BIM_PT_object_material(Panel): self.oprops = context.active_object.BIMObjectProperties self.props = context.active_object.BIMObjectMaterialProperties if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) if self.oprops.ifc_definition_id not in Data.products: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.product_data = Data.products[self.oprops.ifc_definition_id] if not Data.materials: diff --git a/src/ifcblenderexport/blenderbim/bim/module/model/grid.py b/src/ifcblenderexport/blenderbim/bim/module/model/grid.py index 6f57f76ce3..e14d0b7017 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/model/grid.py +++ b/src/ifcblenderexport/blenderbim/bim/module/model/grid.py @@ -1,6 +1,6 @@ import bpy -import blenderbim.bim.module.grid.create_grid_axis as create_grid_axis -import blenderbim.bim.module.grid.create_axis_curve as create_axis_curve +import ifcopenshell.api.grid.create_grid_axis as create_grid_axis +import ifcopenshell.api.grid.create_axis_curve as create_axis_curve from bpy.types import Operator from bpy.props import FloatProperty, IntProperty from mathutils import Vector diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/operator.py b/src/ifcblenderexport/blenderbim/bim/module/owner/operator.py index 9fed15eb7c..d8b0b261fa 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/owner/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/owner/operator.py @@ -1,19 +1,19 @@ import bpy import json -import blenderbim.bim.module.owner.add_person as add_person -import blenderbim.bim.module.owner.edit_person as edit_person -import blenderbim.bim.module.owner.remove_person as remove_person -import blenderbim.bim.module.owner.add_organisation as add_organisation -import blenderbim.bim.module.owner.edit_organisation as edit_organisation -import blenderbim.bim.module.owner.remove_organisation as remove_organisation -import blenderbim.bim.module.owner.add_role as add_role -import blenderbim.bim.module.owner.edit_role as edit_role -import blenderbim.bim.module.owner.remove_role as remove_role -import blenderbim.bim.module.owner.add_address as add_address -import blenderbim.bim.module.owner.edit_address as edit_address -import blenderbim.bim.module.owner.remove_address as remove_address +import ifcopenshell.api.owner.add_person as add_person +import ifcopenshell.api.owner.edit_person as edit_person +import ifcopenshell.api.owner.remove_person as remove_person +import ifcopenshell.api.owner.add_organisation as add_organisation +import ifcopenshell.api.owner.edit_organisation as edit_organisation +import ifcopenshell.api.owner.remove_organisation as remove_organisation +import ifcopenshell.api.owner.add_role as add_role +import ifcopenshell.api.owner.edit_role as edit_role +import ifcopenshell.api.owner.remove_role as remove_role +import ifcopenshell.api.owner.add_address as add_address +import ifcopenshell.api.owner.edit_address as edit_address +import ifcopenshell.api.owner.remove_address as remove_address from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.owner.data import Data +from ifcopenshell.api.owner.data import Data class EnableEditingPerson(bpy.types.Operator): @@ -51,7 +51,7 @@ class AddPerson(bpy.types.Operator): def execute(self, context): add_person.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -76,7 +76,7 @@ class EditPerson(bpy.types.Operator): edit_person.Usecase( self.file, {"person": self.file.by_id(props.active_person_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_person() return {"FINISHED"} @@ -89,7 +89,7 @@ class RemovePerson(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() remove_person.Usecase(self.file, {"person": self.file.by_id(self.person_id)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -126,7 +126,7 @@ class AddRole(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() add_role.Usecase(self.file, {"assigned_object": self.file.by_id(self.assigned_object_id)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -145,7 +145,7 @@ class EditRole(bpy.types.Operator): edit_role.Usecase( self.file, {"role": self.file.by_id(props.active_role_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_role() return {"FINISHED"} @@ -158,7 +158,7 @@ class RemoveRole(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() remove_role.Usecase(self.file, {"role": self.file.by_id(self.role_id)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -173,7 +173,7 @@ class AddAddress(bpy.types.Operator): add_address.Usecase( self.file, {"assigned_object": self.file.by_id(self.assigned_object_id), "ifc_class": self.ifc_class} ).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -267,7 +267,7 @@ class EditAddress(bpy.types.Operator): "Country": props.address.country or None, }) edit_address.Usecase(self.file, {"address": address, "attributes": attributes}).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_address() return {"FINISHED"} @@ -280,7 +280,7 @@ class RemoveAddress(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() remove_address.Usecase(self.file, {"address": self.file.by_id(self.address_id)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -316,7 +316,7 @@ class AddOrganisation(bpy.types.Operator): def execute(self, context): add_organisation.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -338,7 +338,7 @@ class EditOrganisation(bpy.types.Operator): edit_organisation.Usecase( self.file, {"organisation": self.file.by_id(props.active_organisation_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.disable_editing_organisation() return {"FINISHED"} @@ -351,5 +351,5 @@ class RemoveOrganisation(bpy.types.Operator): def execute(self, context): self.file = IfcStore.get_file() remove_organisation.Usecase(self.file, {"organisation": self.file.by_id(self.organisation_id)}).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/prop.py b/src/ifcblenderexport/blenderbim/bim/module/owner/prop.py index da71f4b064..63333bb551 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/owner/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/owner/prop.py @@ -1,6 +1,6 @@ import bpy from blenderbim.bim.prop import StrProperty, Attribute -from blenderbim.bim.module.owner.data import Data +from ifcopenshell.api.owner.data import Data from bpy.types import PropertyGroup from bpy.props import ( PointerProperty, @@ -16,7 +16,7 @@ from bpy.props import ( def getPersons(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) results = [] for ifc_id, person in Data.people.items(): if "Id" in person: @@ -29,7 +29,7 @@ def getPersons(self, context): def getOrganisations(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) results = [] for ifc_id, organisation in Data.organisations.items(): results.append((str(ifc_id), organisation["Name"], "")) diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/ui.py b/src/ifcblenderexport/blenderbim/bim/module/owner/ui.py index d0b82a39c0..d47cc605e5 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/owner/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/owner/ui.py @@ -1,6 +1,6 @@ import bpy from bpy.types import Panel -from blenderbim.bim.module.owner.data import Data +from ifcopenshell.api.owner.data import Data from blenderbim.bim.ifc import IfcStore @@ -106,7 +106,7 @@ class BIM_PT_people(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.file = IfcStore.get_file() self.layout.use_property_split = True @@ -166,7 +166,7 @@ class BIM_PT_organisations(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.file = IfcStore.get_file() self.layout.use_property_split = True @@ -215,7 +215,7 @@ class BIM_PT_owner(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.layout.use_property_split = True self.layout.use_property_decorate = False diff --git a/src/ifcblenderexport/blenderbim/bim/module/project/operator.py b/src/ifcblenderexport/blenderbim/bim/module/project/operator.py index b6ac9fbafe..e7e9610b47 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/project/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/project/operator.py @@ -1,11 +1,11 @@ import bpy import logging import ifcopenshell -import blenderbim.bim.module.project.create_file as create_file +import ifcopenshell.api.project.create_file as create_file import bpy from blenderbim.bim.ifc import IfcStore -# from blenderbim.bim.module.project.data import Data +# from ifcopenshell.api.project.data import Data class CreateProject(bpy.types.Operator): diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/operator.py b/src/ifcblenderexport/blenderbim/bim/module/pset/operator.py index 7eaa907c3e..92e85ea32f 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset/operator.py @@ -1,13 +1,13 @@ import bpy import json import ifcopenshell.util.unit -import blenderbim.bim.module.pset.add_pset as add_pset -import blenderbim.bim.module.pset.edit_pset as edit_pset -import blenderbim.bim.module.pset.remove_pset as remove_pset -import blenderbim.bim.module.pset.add_qto as add_qto -import blenderbim.bim.module.pset.edit_qto as edit_qto +import ifcopenshell.api.pset.add_pset as add_pset +import ifcopenshell.api.pset.edit_pset as edit_pset +import ifcopenshell.api.pset.remove_pset as remove_pset +import ifcopenshell.api.pset.add_qto as add_qto +import ifcopenshell.api.pset.edit_qto as edit_qto from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.pset.data import Data +from ifcopenshell.api.pset.data import Data from blenderbim.bim.module.pset.qto_calculator import QtoCalculator @@ -137,7 +137,7 @@ class EditPset(bpy.types.Operator): "Properties": properties, }, ).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) bpy.ops.bim.disable_pset_editing(obj=self.obj, obj_type=self.obj_type) return {"FINISHED"} @@ -163,7 +163,7 @@ class RemovePset(bpy.types.Operator): "pset": self.file.by_id(self.pset_id), }, ).execute() - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) return {"FINISHED"} @@ -197,7 +197,7 @@ class AddPset(bpy.types.Operator): "Name": pset_name, }, ).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) return {"FINISHED"} @@ -217,7 +217,7 @@ class AddQto(bpy.types.Operator): "Name": props.qto_name, }, ).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/prop.py b/src/ifcblenderexport/blenderbim/bim/module/pset/prop.py index 5e78835483..42c2904e8a 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset/prop.py @@ -1,6 +1,6 @@ import bpy from blenderbim.bim.prop import Attribute -from blenderbim.bim.module.pset.data import Data +from ifcopenshell.api.pset.data import Data import blenderbim.bim.schema from bpy.types import PropertyGroup from bpy.props import ( diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/ui.py b/src/ifcblenderexport/blenderbim/bim/module/pset/ui.py index d086b4f22d..d6f5110a74 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset/ui.py @@ -1,5 +1,5 @@ from bpy.types import Panel -from blenderbim.bim.module.pset.data import Data +from ifcopenshell.api.pset.data import Data from blenderbim.bim.ifc import IfcStore @@ -100,7 +100,7 @@ class BIM_PT_object_psets(Panel): if not props.ifc_definition_id: return False if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if not Data.products[props.ifc_definition_id]: return False return True @@ -111,7 +111,7 @@ class BIM_PT_object_psets(Panel): if not oprops.ifc_definition_id: return if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) row = self.layout.row(align=True) row.prop(props, "pset_name", text="") op = row.operator("bim.add_pset", icon="ADD", text="") @@ -143,7 +143,7 @@ class BIM_PT_object_qtos(Panel): if not props.ifc_definition_id: return False if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if not Data.products[props.ifc_definition_id]: return False return True @@ -154,7 +154,7 @@ class BIM_PT_object_qtos(Panel): if not oprops.ifc_definition_id: return if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) row = self.layout.row(align=True) row.prop(props, "qto_name", text="") row.operator("bim.add_qto", icon="ADD", text="") @@ -183,7 +183,7 @@ class BIM_PT_material_psets(Panel): if IfcStore.get_file().schema == "IFC2X3": return False # We don't support material psets in IFC2X3 because they suck if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if not Data.products[props.ifc_definition_id]: return False return True @@ -194,7 +194,7 @@ class BIM_PT_material_psets(Panel): if not oprops.ifc_definition_id: return if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) row = self.layout.row(align=True) row.prop(props, "material_pset_name", text="") op = row.operator("bim.add_pset", icon="ADD", text="") diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/operator.py b/src/ifcblenderexport/blenderbim/bim/module/pset_template/operator.py index 6193be7a68..3037dede5a 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset_template/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset_template/operator.py @@ -1,13 +1,13 @@ import bpy import ifcopenshell -import blenderbim.bim.module.pset_template.add_pset_template as add_pset_template -import blenderbim.bim.module.pset_template.edit_pset_template as edit_pset_template -import blenderbim.bim.module.pset_template.remove_pset_template as remove_pset_template -import blenderbim.bim.module.pset_template.add_prop_template as add_prop_template -import blenderbim.bim.module.pset_template.edit_prop_template as edit_prop_template -import blenderbim.bim.module.pset_template.remove_prop_template as remove_prop_template +import ifcopenshell.api.pset_template.add_pset_template as add_pset_template +import ifcopenshell.api.pset_template.edit_pset_template as edit_pset_template +import ifcopenshell.api.pset_template.remove_pset_template as remove_pset_template +import ifcopenshell.api.pset_template.add_prop_template as add_prop_template +import ifcopenshell.api.pset_template.edit_prop_template as edit_prop_template +import ifcopenshell.api.pset_template.remove_prop_template as remove_prop_template from blenderbim.bim.module.pset_template.prop import updatePsetTemplateFiles, updatePsetTemplates -from blenderbim.bim.module.pset_template.data import Data +from ifcopenshell.api.pset_template.data import Data from blenderbim.bim.ifc import IfcStore @@ -18,7 +18,7 @@ class AddPsetTemplate(bpy.types.Operator): def execute(self, context): props = context.scene.BIMPsetTemplateProperties add_pset_template.Usecase(IfcStore.pset_template_file).execute() - Data.load() + Data.load(IfcStore.pset_template_file) updatePsetTemplates(self, context) return {"FINISHED"} @@ -34,7 +34,7 @@ class RemovePsetTemplate(bpy.types.Operator): remove_pset_template.Usecase(IfcStore.pset_template_file, { "pset_template": IfcStore.pset_template_file.by_id(int(props.pset_templates)) }).execute() - Data.load() + Data.load(IfcStore.pset_template_file) updatePsetTemplates(self, context) return {"FINISHED"} @@ -105,7 +105,7 @@ class EditPsetTemplate(bpy.types.Operator): "ApplicableEntity": props.active_pset_template.applicable_entity, } }).execute() - Data.load() + Data.load(IfcStore.pset_template_file) updatePsetTemplates(self, context) bpy.ops.bim.disable_editing_pset_template() return {"FINISHED"} @@ -130,7 +130,7 @@ class AddPropTemplate(bpy.types.Operator): add_prop_template.Usecase(IfcStore.pset_template_file, { "pset_template": IfcStore.pset_template_file.by_id(pset_template_id) }).execute() - Data.load() + Data.load(IfcStore.pset_template_file) return {"FINISHED"} @@ -144,7 +144,7 @@ class RemovePropTemplate(bpy.types.Operator): remove_prop_template.Usecase(IfcStore.pset_template_file, { "prop_template": IfcStore.pset_template_file.by_id(self.prop_template) }).execute() - Data.load() + Data.load(IfcStore.pset_template_file) return {"FINISHED"} @@ -162,6 +162,6 @@ class EditPropTemplate(bpy.types.Operator): "PrimaryMeasureType": props.active_prop_template.primary_measure_type, } }).execute() - Data.load() + Data.load(IfcStore.pset_template_file) bpy.ops.bim.disable_editing_prop_template() return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/prop.py b/src/ifcblenderexport/blenderbim/bim/module/pset_template/prop.py index e5f812f6a7..9a570bf5a0 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset_template/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset_template/prop.py @@ -14,7 +14,7 @@ from bpy.props import ( FloatVectorProperty, CollectionProperty, ) -from blenderbim.bim.module.pset_template.data import Data +from ifcopenshell.api.pset_template.data import Data psettemplatefiles_enum = [] @@ -58,7 +58,7 @@ def getPsetTemplates(self, context): IfcStore.pset_template_file = ifcopenshell.open(IfcStore.pset_template_path) templates = IfcStore.pset_template_file.by_type("IfcPropertySetTemplate") psettemplates_enum.extend([(str(t.id()), t.Name, "") for t in templates]) - Data.load() + Data.load(IfcStore.get_file()) return psettemplates_enum diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/ui.py b/src/ifcblenderexport/blenderbim/bim/module/pset_template/ui.py index 609761bab2..49813c0c96 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset_template/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/pset_template/ui.py @@ -1,6 +1,7 @@ import bpy from bpy.types import Panel -from blenderbim.bim.module.pset_template.data import Data +from blenderbim.bim.ifc import IfcStore +from ifcopenshell.api.pset_template.data import Data class BIM_PT_pset_template(Panel): @@ -37,7 +38,7 @@ class BIM_PT_pset_template(Panel): # row.operator("bim.save_pset_template", text="", icon="EXPORT") if not Data.is_loaded and props.pset_template_files: - Data.load() + Data.load(IfcStore.get_file()) if not Data.pset_templates: return diff --git a/src/ifcblenderexport/blenderbim/bim/module/qto/prop.py b/src/ifcblenderexport/blenderbim/bim/module/qto/prop.py index ef3b6f0369..205d3e39ef 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/qto/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/qto/prop.py @@ -1,6 +1,5 @@ import bpy from blenderbim.bim.prop import StrProperty, Attribute -from blenderbim.bim.module.owner.data import Data from bpy.types import PropertyGroup from bpy.props import ( PointerProperty, diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/operator.py b/src/ifcblenderexport/blenderbim/bim/module/root/operator.py index 804941a595..0bc53a383e 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/root/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/root/operator.py @@ -3,11 +3,11 @@ import numpy as np import ifcopenshell import ifcopenshell.util.schema import ifcopenshell.util.element -import blenderbim.bim.module.root.create_product as create_product -import blenderbim.bim.module.root.remove_product as remove_product -import blenderbim.bim.module.root.reassign_class as reassign_class -import blenderbim.bim.module.root.copy_class as copy_class -from blenderbim.bim.module.geometry.data import Data as GeometryData +import ifcopenshell.api.root.create_product as create_product +import ifcopenshell.api.root.remove_product as remove_product +import ifcopenshell.api.root.reassign_class as reassign_class +import ifcopenshell.api.root.copy_class as copy_class +from ifcopenshell.api.geometry.data import Data as GeometryData from blenderbim.bim.ifc import IfcStore @@ -184,21 +184,14 @@ class UnassignClass(bpy.types.Operator): if not obj.BIMObjectProperties.ifc_definition_id: continue product = self.file.by_id(obj.BIMObjectProperties.ifc_definition_id) - self.remove_representations(obj, product) IfcStore.unlink_element(product, obj) remove_product.Usecase(self.file, {"product": product}).execute() - # TODO: remove object placement if "/" in obj.name and obj.name[0:3] == "Ifc": obj.name = "/".join(obj.name.split("/")[1:]) if obj.data and obj.data.name == "Void": bpy.data.objects.remove(obj) return {"FINISHED"} - def remove_representations(self, obj, product): - GeometryData.load(product.id()) - for representation_id in GeometryData.products[product.id()]: - bpy.ops.bim.remove_representation(obj=obj.name, representation_id=representation_id) - class UnlinkObject(bpy.types.Operator): bl_idname = "bim.unlink_object" diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/remove_product.py b/src/ifcblenderexport/blenderbim/bim/module/root/remove_product.py deleted file mode 100644 index 31ca4be404..0000000000 --- a/src/ifcblenderexport/blenderbim/bim/module/root/remove_product.py +++ /dev/null @@ -1,11 +0,0 @@ -class Usecase: - def __init__(self, file, settings=None): - self.file = file - self.settings = { - "product": None - } - for key, value in settings.items(): - self.settings[key] = value - - def execute(self): - self.file.remove(self.settings["product"]) diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/ui.py b/src/ifcblenderexport/blenderbim/bim/module/root/ui.py index b973cfa1f0..d30a7ffe40 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/root/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/root/ui.py @@ -1,6 +1,6 @@ import bpy from bpy.types import Panel -from blenderbim.bim.module.root.data import Data +from ifcopenshell.api.root.data import Data from blenderbim.bim.ifc import IfcStore @@ -20,7 +20,7 @@ class BIM_PT_class(Panel): if props.ifc_definition_id: if props.ifc_definition_id not in Data.products: try: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) except: row = self.layout.row(align=True) row.label(text="IFC Element Not Found") diff --git a/src/ifcblenderexport/blenderbim/bim/module/sequence/operator.py b/src/ifcblenderexport/blenderbim/bim/module/sequence/operator.py index 97cb506169..93f3546407 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/sequence/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/sequence/operator.py @@ -1,6 +1,6 @@ import bpy from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.sequence.data import Data +from ifcopenshell.api.sequence.data import Data class LoadTasks(bpy.types.Operator): diff --git a/src/ifcblenderexport/blenderbim/bim/module/sequence/ui.py b/src/ifcblenderexport/blenderbim/bim/module/sequence/ui.py index 7334c7d788..1584189940 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/sequence/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/sequence/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.sequence.data import Data +from ifcopenshell.api.sequence.data import Data class BIM_PT_tasks(Panel): @@ -17,7 +17,7 @@ class BIM_PT_tasks(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMTaskProperties row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/operator.py b/src/ifcblenderexport/blenderbim/bim/module/spatial/operator.py index 8a0c83a9bd..6de73f3abb 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/spatial/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/spatial/operator.py @@ -1,8 +1,8 @@ import bpy -import blenderbim.bim.module.spatial.assign_container as assign_container -import blenderbim.bim.module.spatial.remove_container as remove_container +import ifcopenshell.api.spatial.assign_container as assign_container +import ifcopenshell.api.spatial.remove_container as remove_container from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.spatial.data import Data +from ifcopenshell.api.spatial.data import Data from blenderbim.bim.module.spatial.prop import getSpatialContainers @@ -32,7 +32,7 @@ class AssignContainer(bpy.types.Operator): }, ).execute() bpy.ops.bim.edit_object_placement(obj=related_element.name) - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) bpy.ops.bim.disable_editing_container(obj=related_element.name) aggregate_collection = bpy.data.collections.get(related_element.name) @@ -101,7 +101,7 @@ class RemoveContainer(bpy.types.Operator): oprops = obj.BIMObjectProperties self.file = IfcStore.get_file() remove_container.Usecase(self.file, {"product": self.file.by_id(oprops.ifc_definition_id)}).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) aggregate_collection = bpy.data.collections.get(obj.name) if aggregate_collection: diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/prop.py b/src/ifcblenderexport/blenderbim/bim/module/spatial/prop.py index b64228df37..4f14eacf29 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/spatial/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/module/spatial/prop.py @@ -1,6 +1,6 @@ import bpy from blenderbim.bim.prop import StrProperty, Attribute -from blenderbim.bim.module.spatial.data import Data +from ifcopenshell.api.spatial.data import Data from blenderbim.bim.ifc import IfcStore from bpy.types import PropertyGroup from bpy.props import ( @@ -16,7 +16,7 @@ from bpy.props import ( def getSpatialContainers(self, context, parent_id=None): - Data.load() + Data.load(IfcStore.get_file()) self.file = IfcStore.get_file() props = context.scene.BIMSpatialProperties while len(props.spatial_elements) > 0: diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/ui.py b/src/ifcblenderexport/blenderbim/bim/module/spatial/ui.py index be8dab598a..b54ce3606e 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/spatial/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/spatial/ui.py @@ -1,5 +1,6 @@ from bpy.types import Panel, UIList -from blenderbim.bim.module.spatial.data import Data +from blenderbim.bim.ifc import IfcStore +from ifcopenshell.api.spatial.data import Data class BIM_PT_spatial(Panel): @@ -17,7 +18,7 @@ class BIM_PT_spatial(Panel): if not oprops.ifc_definition_id: return False if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) if not Data.products[oprops.ifc_definition_id]: return False return True @@ -29,7 +30,7 @@ class BIM_PT_spatial(Panel): if not oprops.ifc_definition_id: return if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) if props.is_editing: row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/operator.py b/src/ifcblenderexport/blenderbim/bim/module/structural/operator.py index cf72861d87..f4e2cc3457 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/structural/operator.py @@ -1,15 +1,15 @@ import bpy import json -import blenderbim.bim.module.structural.add_structural_boundary_condition as add_structural_boundary_condition -import blenderbim.bim.module.structural.edit_structural_boundary_condition as edit_structural_boundary_condition -import blenderbim.bim.module.structural.remove_structural_boundary_condition as remove_structural_boundary_condition -import blenderbim.bim.module.structural.add_structural_analysis_model as add_structural_analysis_model -import blenderbim.bim.module.structural.edit_structural_analysis_model as edit_structural_analysis_model -import blenderbim.bim.module.structural.remove_structural_analysis_model as remove_structural_analysis_model -import blenderbim.bim.module.structural.assign_structural_analysis_model as assign_structural_analysis_model -import blenderbim.bim.module.structural.unassign_structural_analysis_model as unassign_structural_analysis_model +import ifcopenshell.api.structural.add_structural_boundary_condition as add_structural_boundary_condition +import ifcopenshell.api.structural.edit_structural_boundary_condition as edit_structural_boundary_condition +import ifcopenshell.api.structural.remove_structural_boundary_condition as remove_structural_boundary_condition +import ifcopenshell.api.structural.add_structural_analysis_model as add_structural_analysis_model +import ifcopenshell.api.structural.edit_structural_analysis_model as edit_structural_analysis_model +import ifcopenshell.api.structural.remove_structural_analysis_model as remove_structural_analysis_model +import ifcopenshell.api.structural.assign_structural_analysis_model as assign_structural_analysis_model +import ifcopenshell.api.structural.unassign_structural_analysis_model as unassign_structural_analysis_model from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.structural.data import Data +from ifcopenshell.api.structural.data import Data class AddStructuralBoundaryCondition(bpy.types.Operator): @@ -21,7 +21,7 @@ class AddStructuralBoundaryCondition(bpy.types.Operator): file = IfcStore.get_file() connection = file.by_id(obj.BIMObjectProperties.ifc_definition_id) add_structural_boundary_condition.Usecase(file, {"connection": connection}).execute() - Data.load(connection.id()) + Data.load(IfcStore.get_file(), connection.id()) return {"FINISHED"} @@ -34,7 +34,7 @@ class RemoveStructuralBoundaryCondition(bpy.types.Operator): file = IfcStore.get_file() connection = file.by_id(obj.BIMObjectProperties.ifc_definition_id) remove_structural_boundary_condition.Usecase(file, {"connection": connection}).execute() - Data.load(connection.id()) + Data.load(IfcStore.get_file(), connection.id()) return {"FINISHED"} @@ -101,7 +101,7 @@ class EditStructuralBoundaryCondition(bpy.types.Operator): attributes[attribute.name] = {"value": attribute.float_value, "type": attribute.enum_value} edit_structural_boundary_condition.Usecase(file, {"condition": condition, "attributes": attributes}).execute() - Data.load(connection.id()) + Data.load(IfcStore.get_file(), connection.id()) bpy.ops.bim.disable_editing_structural_boundary_condition() return {"FINISHED"} @@ -147,7 +147,7 @@ class AddStructuralAnalysisModel(bpy.types.Operator): def execute(self, context): result = add_structural_analysis_model.Usecase(IfcStore.get_file()).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_structural_analysis_models() bpy.ops.bim.enable_editing_structural_analysis_model(structural_analysis_model=result.id()) return {"FINISHED"} @@ -172,7 +172,7 @@ class EditStructuralAnalysisModel(bpy.types.Operator): edit_structural_analysis_model.Usecase( self.file, {"structural_analysis_model": self.file.by_id(props.active_structural_analysis_model_id), "attributes": attributes} ).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_structural_analysis_models() return {"FINISHED"} @@ -186,7 +186,7 @@ class RemoveStructuralAnalysisModel(bpy.types.Operator): props = context.scene.BIMStructuralProperties self.file = IfcStore.get_file() remove_structural_analysis_model.Usecase(self.file, {"structural_analysis_model": self.file.by_id(self.structural_analysis_model)}).execute() - Data.load() + Data.load(IfcStore.get_file()) bpy.ops.bim.load_structural_analysis_models() return {"FINISHED"} @@ -245,7 +245,7 @@ class AssignStructuralAnalysisModel(bpy.types.Operator): "product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id), "structural_analysis_model": self.file.by_id(self.structural_analysis_model) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} @@ -262,5 +262,5 @@ class UnassignStructuralAnalysisModel(bpy.types.Operator): "product": self.file.by_id(product.BIMObjectProperties.ifc_definition_id), "structural_analysis_model": self.file.by_id(self.structural_analysis_model) }).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/ui.py b/src/ifcblenderexport/blenderbim/bim/module/structural/ui.py index e5cead4f98..9c4430ee66 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/structural/ui.py @@ -1,6 +1,6 @@ from bpy.types import Panel, UIList from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.structural.data import Data +from ifcopenshell.api.structural.data import Data class BIM_PT_structural_boundary_conditions(Panel): @@ -26,7 +26,7 @@ class BIM_PT_structural_boundary_conditions(Panel): self.oprops = context.active_object.BIMObjectProperties self.props = context.active_object.BIMStructuralProperties if self.oprops.ifc_definition_id not in Data.boundary_conditions: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.data = Data.boundary_conditions[self.oprops.ifc_definition_id] @@ -98,7 +98,7 @@ class BIM_PT_connected_structural_members(Panel): self.oprops = context.active_object.BIMObjectProperties self.props = context.active_object.BIMStructuralProperties if self.oprops.ifc_definition_id not in Data.connected_structural_members: - Data.load(self.oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), self.oprops.ifc_definition_id) self.data = Data.connected_structural_members[self.oprops.ifc_definition_id] @@ -139,7 +139,7 @@ class BIM_PT_structural_analysis_models(Panel): def draw(self, context): if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) self.props = context.scene.BIMStructuralProperties row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/style/operator.py b/src/ifcblenderexport/blenderbim/bim/module/style/operator.py index 62cce46f0b..26d0b5536d 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/style/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/style/operator.py @@ -1,6 +1,6 @@ import bpy -import blenderbim.bim.module.style.add_style as add_style -import blenderbim.bim.module.style.edit_style as edit_style +import ifcopenshell.api.style.add_style as add_style +import ifcopenshell.api.style.edit_style as edit_style from blenderbim.bim.ifc import IfcStore diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/operator.py b/src/ifcblenderexport/blenderbim/bim/module/type/operator.py index 343d13ee35..bb0df2c164 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/type/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/type/operator.py @@ -1,11 +1,11 @@ import bpy import ifcopenshell.util.schema import ifcopenshell.util.type -import blenderbim.bim.module.type.assign_type as assign_type -import blenderbim.bim.module.type.unassign_type as unassign_type -import blenderbim.bim.module.type.get_related_objects as get_related_objects +import ifcopenshell.api.type.assign_type as assign_type +import ifcopenshell.api.type.unassign_type as unassign_type +import ifcopenshell.api.type.get_related_objects as get_related_objects from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.type.data import Data +from ifcopenshell.api.type.data import Data from blenderbim.bim.module.type.prop import getIfcTypes, getAvailableTypes, updateTypeInstanceIfcClass from mathutils import Vector @@ -31,7 +31,7 @@ class AssignType(bpy.types.Operator): "relating_type": self.file.by_id(relating_type), }, ).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) if self.file.by_id(relating_type).RepresentationMaps: bpy.ops.bim.map_representations(product_id=oprops.ifc_definition_id, type_product_id=relating_type) @@ -57,7 +57,7 @@ class UnassignType(bpy.types.Operator): "related_object": self.file.by_id(oprops.ifc_definition_id), }, ).execute() - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/ui.py b/src/ifcblenderexport/blenderbim/bim/module/type/ui.py index 3a4a88215f..bdee759124 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/type/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/type/ui.py @@ -1,5 +1,6 @@ from bpy.types import Panel -from blenderbim.bim.module.type.data import Data +from blenderbim.bim.ifc import IfcStore +from ifcopenshell.api.type.data import Data class BIM_PT_type(Panel): @@ -15,7 +16,7 @@ class BIM_PT_type(Panel): if not props.ifc_definition_id: return False if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) if not Data.products[props.ifc_definition_id]: return False return True @@ -27,7 +28,7 @@ class BIM_PT_type(Panel): if not oprops.ifc_definition_id: return if oprops.ifc_definition_id not in Data.products: - Data.load(oprops.ifc_definition_id) + Data.load(IfcStore.get_file(), oprops.ifc_definition_id) if props.is_editing_type: row = self.layout.row(align=True) diff --git a/src/ifcblenderexport/blenderbim/bim/module/unit/operator.py b/src/ifcblenderexport/blenderbim/bim/module/unit/operator.py index 5ec9155c8e..f0bed7241f 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/unit/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/unit/operator.py @@ -1,7 +1,7 @@ import bpy -import blenderbim.bim.module.unit.assign_unit as assign_unit +import ifcopenshell.api.unit.assign_unit as assign_unit from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.unit.data import Data +from ifcopenshell.api.unit.data import Data class AssignUnit(bpy.types.Operator): @@ -10,7 +10,7 @@ class AssignUnit(bpy.types.Operator): def execute(self, context): assign_unit.Usecase(IfcStore.get_file(), self.get_units()).execute() - Data.load() + Data.load(IfcStore.get_file()) return {"FINISHED"} def get_units(self): diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/operator.py b/src/ifcblenderexport/blenderbim/bim/module/void/operator.py index cd1f9956e5..efa283eaef 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/void/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/void/operator.py @@ -1,11 +1,11 @@ import bpy -import blenderbim.bim.module.void.add_opening as add_opening -import blenderbim.bim.module.void.remove_opening as remove_opening -import blenderbim.bim.module.void.add_filling as add_filling -import blenderbim.bim.module.void.remove_filling as remove_filling +import ifcopenshell.api.void.add_opening as add_opening +import ifcopenshell.api.void.remove_opening as remove_opening +import ifcopenshell.api.void.add_filling as add_filling +import ifcopenshell.api.void.remove_filling as remove_filling from blenderbim.bim.ifc import IfcStore -from blenderbim.bim.module.void.data import Data -from blenderbim.bim.module.context.data import Data as ContextData +from ifcopenshell.api.void.data import Data +from ifcopenshell.api.context.data import Data as ContextData class AddOpening(bpy.types.Operator): @@ -21,7 +21,7 @@ class AddOpening(bpy.types.Operator): if not opening.BIMObjectProperties.ifc_definition_id: body_context_id = None if not ContextData.is_loaded: - ContextData.load() + ContextData.load(IfcStore.get_file()) for context in ContextData.contexts.values(): for subcontext_id, subcontext in context["HasSubContexts"].items(): if subcontext["ContextType"] == "Model" and subcontext["ContextIdentifier"] == "Body": @@ -40,7 +40,7 @@ class AddOpening(bpy.types.Operator): "element": self.file.by_id(element_id), }, ).execute() - Data.load(element_id) + Data.load(IfcStore.get_file(), element_id) has_modifier = False @@ -76,7 +76,7 @@ class RemoveOpening(bpy.types.Operator): break remove_opening.Usecase(self.file, {"opening": self.file.by_id(self.opening_id)}).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} @@ -98,7 +98,7 @@ class AddFilling(bpy.types.Operator): "element": self.file.by_id(element_id), }, ).execute() - Data.load(element_id) + Data.load(IfcStore.get_file(), element_id) return {"FINISHED"} @@ -113,5 +113,5 @@ class RemoveFilling(bpy.types.Operator): remove_filling.Usecase( self.file, {"element": self.file.by_id(obj.BIMObjectProperties.ifc_definition_id)} ).execute() - Data.load(obj.BIMObjectProperties.ifc_definition_id) + Data.load(IfcStore.get_file(), obj.BIMObjectProperties.ifc_definition_id) return {"FINISHED"} diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/ui.py b/src/ifcblenderexport/blenderbim/bim/module/void/ui.py index c878d8ccea..548ff2f096 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/void/ui.py +++ b/src/ifcblenderexport/blenderbim/bim/module/void/ui.py @@ -1,6 +1,6 @@ import bpy from bpy.types import Panel -from blenderbim.bim.module.void.data import Data +from ifcopenshell.api.void.data import Data from blenderbim.bim.ifc import IfcStore @@ -19,7 +19,7 @@ class BIM_PT_voids(Panel): def draw(self, context): props = context.active_object.BIMObjectProperties if props.ifc_definition_id not in Data.products: - Data.load(props.ifc_definition_id) + Data.load(IfcStore.get_file(), props.ifc_definition_id) row = self.layout.row(align=True) if len(context.selected_objects) == 2: diff --git a/src/ifcblenderexport/blenderbim/bim/prop.py b/src/ifcblenderexport/blenderbim/bim/prop.py index 4ee0227dea..4fd5c35797 100644 --- a/src/ifcblenderexport/blenderbim/bim/prop.py +++ b/src/ifcblenderexport/blenderbim/bim/prop.py @@ -163,10 +163,10 @@ def getMaterialPsetNames(self, context): def getContexts(self, context): - from blenderbim.bim.module.context.data import Data + from ifcopenshell.api.context.data import Data if not Data.is_loaded: - Data.load() + Data.load(IfcStore.get_file()) results = [] for ifc_id, context in Data.contexts.items(): results.append((str(ifc_id), context["ContextType"], "")) diff --git a/src/ifcblenderexport/blenderbim/bim/module/aggregate/assign_object.py b/src/ifcopenshell-python/ifcopenshell/api/aggregate/assign_object.py similarity index 93% rename from src/ifcblenderexport/blenderbim/bim/module/aggregate/assign_object.py rename to src/ifcopenshell-python/ifcopenshell/api/aggregate/assign_object.py index 6a3dd1b946..cc4d199f56 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/aggregate/assign_object.py +++ b/src/ifcopenshell-python/ifcopenshell/api/aggregate/assign_object.py @@ -1,6 +1,6 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import create_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/aggregate/data.py b/src/ifcopenshell-python/ifcopenshell/api/aggregate/data.py similarity index 82% rename from src/ifcblenderexport/blenderbim/bim/module/aggregate/data.py rename to src/ifcopenshell-python/ifcopenshell/api/aggregate/data.py index 67ff085df2..88d783f1f6 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/aggregate/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/aggregate/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} @@ -9,8 +6,7 @@ class Data: cls.products = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return product = file.by_id(product_id) diff --git a/src/ifcblenderexport/blenderbim/bim/module/attribute/data.py b/src/ifcopenshell-python/ifcopenshell/api/attribute/data.py similarity index 88% rename from src/ifcblenderexport/blenderbim/bim/module/attribute/data.py rename to src/ifcopenshell-python/ifcopenshell/api/attribute/data.py index 2458759c89..a6750c18fd 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/attribute/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/attribute/data.py @@ -1,6 +1,5 @@ import ifcopenshell import ifcopenshell.util.attribute -from blenderbim.bim.ifc import IfcStore class Data: @@ -11,13 +10,13 @@ class Data: cls.products = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return product = file.by_id(product_id) + schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(file.schema) cls.products[product_id] = [] - declaration = IfcStore.get_schema().declaration_by_name(product.is_a()) + declaration = schema.declaration_by_name(product.is_a()) for attribute in declaration.all_attributes(): data_type = ifcopenshell.util.attribute.get_primitive_type(attribute) value = getattr(product, attribute.name()) diff --git a/src/ifcblenderexport/blenderbim/bim/module/attribute/edit_attributes.py b/src/ifcopenshell-python/ifcopenshell/api/attribute/edit_attributes.py similarity index 89% rename from src/ifcblenderexport/blenderbim/bim/module/attribute/edit_attributes.py rename to src/ifcopenshell-python/ifcopenshell/api/attribute/edit_attributes.py index 4e45c6b61b..ea9b978dd6 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/attribute/edit_attributes.py +++ b/src/ifcopenshell-python/ifcopenshell/api/attribute/edit_attributes.py @@ -1,4 +1,4 @@ -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase(): diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/add_classification.py b/src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/add_classification.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/add_classification.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/add_reference.py b/src/ifcopenshell-python/ifcopenshell/api/classification/add_reference.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/add_reference.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/add_reference.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/data.py b/src/ifcopenshell-python/ifcopenshell/api/classification/data.py similarity index 95% rename from src/ifcblenderexport/blenderbim/bim/module/classification/data.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/data.py index 0a5f8c367a..00b39ab610 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/classification/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/classification/data.py @@ -1,6 +1,5 @@ import ifcopenshell import ifcopenshell.util.date -from blenderbim.bim.ifc import IfcStore class Data: @@ -23,8 +22,8 @@ class Data: cls.library_references = {} @classmethod - def load(cls, product_id=None): - cls._file = IfcStore.get_file() + def load(cls, file, product_id=None): + cls._file = file if not cls._file: return if product_id: diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/edit_classification.py b/src/ifcopenshell-python/ifcopenshell/api/classification/edit_classification.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/edit_classification.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/edit_classification.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/edit_reference.py b/src/ifcopenshell-python/ifcopenshell/api/classification/edit_reference.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/edit_reference.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/edit_reference.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/remove_classification.py b/src/ifcopenshell-python/ifcopenshell/api/classification/remove_classification.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/remove_classification.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/remove_classification.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/classification/remove_reference.py b/src/ifcopenshell-python/ifcopenshell/api/classification/remove_reference.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/classification/remove_reference.py rename to src/ifcopenshell-python/ifcopenshell/api/classification/remove_reference.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/add_objective.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/add_objective.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/add_objective.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/add_objective.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/assign_constraint.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/assign_constraint.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/assign_constraint.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/data.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/data.py similarity index 92% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/data.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/data.py index 165a40902d..aaae145eaf 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/constraint/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/constraint/data.py @@ -1,6 +1,5 @@ import ifcopenshell import ifcopenshell.util.date -from blenderbim.bim.ifc import IfcStore from datetime import datetime @@ -16,8 +15,8 @@ class Data: cls.objectives = {} @classmethod - def load(cls, product_id=None): - cls._file = IfcStore.get_file() + def load(cls, file, product_id=None): + cls._file = file if not cls._file: return if product_id: diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/edit_objective.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/edit_objective.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/edit_objective.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/edit_objective.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/remove_constraint.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/remove_constraint.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/remove_constraint.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/remove_constraint.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/constraint/unassign_constraint.py b/src/ifcopenshell-python/ifcopenshell/api/constraint/unassign_constraint.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/constraint/unassign_constraint.py rename to src/ifcopenshell-python/ifcopenshell/api/constraint/unassign_constraint.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/context/add_context.py b/src/ifcopenshell-python/ifcopenshell/api/context/add_context.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/context/add_context.py rename to src/ifcopenshell-python/ifcopenshell/api/context/add_context.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/context/data.py b/src/ifcopenshell-python/ifcopenshell/api/context/data.py similarity index 89% rename from src/ifcblenderexport/blenderbim/bim/module/context/data.py rename to src/ifcopenshell-python/ifcopenshell/api/context/data.py index 08fe2c1fe9..cd2380bbcf 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/context/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/context/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False contexts = {} @@ -11,8 +8,7 @@ class Data: cls.contexts = {} @classmethod - def load(cls): - file = IfcStore.get_file() + def load(cls, file): if not file: return cls.contexts = {} diff --git a/src/ifcblenderexport/blenderbim/bim/module/context/remove_context.py b/src/ifcopenshell-python/ifcopenshell/api/context/remove_context.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/context/remove_context.py rename to src/ifcopenshell-python/ifcopenshell/api/context/remove_context.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/add_information.py b/src/ifcopenshell-python/ifcopenshell/api/document/add_information.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/add_information.py rename to src/ifcopenshell-python/ifcopenshell/api/document/add_information.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/add_reference.py b/src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/add_reference.py rename to src/ifcopenshell-python/ifcopenshell/api/document/add_reference.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/assign_document.py b/src/ifcopenshell-python/ifcopenshell/api/document/assign_document.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/assign_document.py rename to src/ifcopenshell-python/ifcopenshell/api/document/assign_document.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/data.py b/src/ifcopenshell-python/ifcopenshell/api/document/data.py similarity index 95% rename from src/ifcblenderexport/blenderbim/bim/module/document/data.py rename to src/ifcopenshell-python/ifcopenshell/api/document/data.py index 1e3eb3184c..ec67429ecd 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/document/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/document/data.py @@ -1,6 +1,5 @@ import ifcopenshell import ifcopenshell.util.date -from blenderbim.bim.ifc import IfcStore from datetime import datetime @@ -18,8 +17,8 @@ class Data: cls.information = {} @classmethod - def load(cls, product_id=None): - cls._file = IfcStore.get_file() + def load(cls, file, product_id=None): + cls._file = file if not cls._file: return if product_id: diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/edit_information.py b/src/ifcopenshell-python/ifcopenshell/api/document/edit_information.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/edit_information.py rename to src/ifcopenshell-python/ifcopenshell/api/document/edit_information.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/edit_reference.py b/src/ifcopenshell-python/ifcopenshell/api/document/edit_reference.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/edit_reference.py rename to src/ifcopenshell-python/ifcopenshell/api/document/edit_reference.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/remove_document.py b/src/ifcopenshell-python/ifcopenshell/api/document/remove_document.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/remove_document.py rename to src/ifcopenshell-python/ifcopenshell/api/document/remove_document.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/document/unassign_document.py b/src/ifcopenshell-python/ifcopenshell/api/document/unassign_document.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/document/unassign_document.py rename to src/ifcopenshell-python/ifcopenshell/api/document/unassign_document.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/add_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/add_representation.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/add_representation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/assign_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/assign_representation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/assign_representation.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/assign_representation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/assign_styles.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/assign_styles.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/assign_styles.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/assign_styles.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/data.py similarity index 92% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/data.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/data.py index 63fd96fbdf..c72cc104cf 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/geometry/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} representations = {} @@ -11,8 +8,7 @@ class Data: cls.representations = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return cls.products[product_id] = [] diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/edit_object_placement.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/edit_object_placement.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/edit_object_placement.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/edit_object_placement.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/map_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/map_representation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/map_representation.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/map_representation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/remove_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/remove_representation.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/remove_representation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/geometry/unassign_representation.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py similarity index 97% rename from src/ifcblenderexport/blenderbim/bim/module/geometry/unassign_representation.py rename to src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py index ec99e71772..3da91d5787 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/geometry/unassign_representation.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/unassign_representation.py @@ -1,4 +1,4 @@ -import blenderbim.bim.module.geometry.remove_representation as remove_representation +import ifcopenshell.api.geometry.remove_representation as remove_representation import ifcopenshell.util.element diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/add_georeferencing.py b/src/ifcopenshell-python/ifcopenshell/api/georeference/add_georeferencing.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/georeference/add_georeferencing.py rename to src/ifcopenshell-python/ifcopenshell/api/georeference/add_georeferencing.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/data.py b/src/ifcopenshell-python/ifcopenshell/api/georeference/data.py similarity index 91% rename from src/ifcblenderexport/blenderbim/bim/module/georeference/data.py rename to src/ifcopenshell-python/ifcopenshell/api/georeference/data.py index b6efe005db..b8d029b2be 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/georeference/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/georeference/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False map_conversion = {} @@ -13,8 +10,7 @@ class Data: cls.projected_crs = {} @classmethod - def load(cls): - file = IfcStore.get_file() + def load(cls, file): if not file: return cls.map_conversion = {} diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/edit_georeferencing.py b/src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/georeference/edit_georeferencing.py rename to src/ifcopenshell-python/ifcopenshell/api/georeference/edit_georeferencing.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/georeference/remove_georeferencing.py b/src/ifcopenshell-python/ifcopenshell/api/georeference/remove_georeferencing.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/georeference/remove_georeferencing.py rename to src/ifcopenshell-python/ifcopenshell/api/georeference/remove_georeferencing.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/grid/create_axis_curve.py b/src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/grid/create_axis_curve.py rename to src/ifcopenshell-python/ifcopenshell/api/grid/create_axis_curve.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/grid/create_grid_axis.py b/src/ifcopenshell-python/ifcopenshell/api/grid/create_grid_axis.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/grid/create_grid_axis.py rename to src/ifcopenshell-python/ifcopenshell/api/grid/create_grid_axis.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/add_group.py b/src/ifcopenshell-python/ifcopenshell/api/group/add_group.py similarity index 87% rename from src/ifcblenderexport/blenderbim/bim/module/group/add_group.py rename to src/ifcopenshell-python/ifcopenshell/api/group/add_group.py index 7a7559bd91..ac24f9cdab 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/add_group.py +++ b/src/ifcopenshell-python/ifcopenshell/api/group/add_group.py @@ -1,5 +1,5 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history +from ifcopenshell.api.owner.api import create_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/assign_group.py b/src/ifcopenshell-python/ifcopenshell/api/group/assign_group.py similarity index 87% rename from src/ifcblenderexport/blenderbim/bim/module/group/assign_group.py rename to src/ifcopenshell-python/ifcopenshell/api/group/assign_group.py index 99b4e8308a..73e86e80d0 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/assign_group.py +++ b/src/ifcopenshell-python/ifcopenshell/api/group/assign_group.py @@ -1,6 +1,6 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import create_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/data.py b/src/ifcopenshell-python/ifcopenshell/api/group/data.py similarity index 80% rename from src/ifcblenderexport/blenderbim/bim/module/group/data.py rename to src/ifcopenshell-python/ifcopenshell/api/group/data.py index 0524bb3501..bcfffbe5b2 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/group/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False products = {} @@ -13,10 +10,10 @@ class Data: cls.groups = {} @classmethod - def load(cls): + def load(cls, file): cls.products = {} cls.groups = {} - for group in IfcStore.get_file().by_type("IfcGroup", include_subtypes=False): + for group in file.by_type("IfcGroup", include_subtypes=False): if group.IsGroupedBy: for rel in group.IsGroupedBy: for product in rel.RelatedObjects: diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/edit_group.py b/src/ifcopenshell-python/ifcopenshell/api/group/edit_group.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/group/edit_group.py rename to src/ifcopenshell-python/ifcopenshell/api/group/edit_group.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/remove_group.py b/src/ifcopenshell-python/ifcopenshell/api/group/remove_group.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/group/remove_group.py rename to src/ifcopenshell-python/ifcopenshell/api/group/remove_group.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/group/unassign_group.py b/src/ifcopenshell-python/ifcopenshell/api/group/unassign_group.py similarity index 91% rename from src/ifcblenderexport/blenderbim/bim/module/group/unassign_group.py rename to src/ifcopenshell-python/ifcopenshell/api/group/unassign_group.py index 84ffbcec39..92e43fe408 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/group/unassign_group.py +++ b/src/ifcopenshell-python/ifcopenshell/api/group/unassign_group.py @@ -1,5 +1,5 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/add_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/add_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/layer/add_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/add_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/assign_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/layer/assign_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/assign_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/data.py b/src/ifcopenshell-python/ifcopenshell/api/layer/data.py similarity index 89% rename from src/ifcblenderexport/blenderbim/bim/module/layer/data.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/data.py index c77a91dcad..6bb53498e2 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/layer/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/layer/data.py @@ -1,6 +1,5 @@ import ifcopenshell import ifcopenshell.util.date -from blenderbim.bim.ifc import IfcStore from datetime import datetime @@ -16,8 +15,8 @@ class Data: cls.layers = {} @classmethod - def load(cls): - cls._file = IfcStore.get_file() + def load(cls, file): + cls._file = file if not cls._file: return cls.load_layers() diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/edit_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/edit_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/layer/edit_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/edit_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/remove_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/remove_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/layer/remove_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/remove_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/layer/unassign_layer.py b/src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/layer/unassign_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/layer/unassign_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/add_constituent.py b/src/ifcopenshell-python/ifcopenshell/api/material/add_constituent.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/add_constituent.py rename to src/ifcopenshell-python/ifcopenshell/api/material/add_constituent.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/add_layer.py b/src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/add_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/material/add_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/add_list_item.py b/src/ifcopenshell-python/ifcopenshell/api/material/add_list_item.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/add_list_item.py rename to src/ifcopenshell-python/ifcopenshell/api/material/add_list_item.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/add_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/add_material.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/add_material.py rename to src/ifcopenshell-python/ifcopenshell/api/material/add_material.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/assign_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/assign_material.py rename to src/ifcopenshell-python/ifcopenshell/api/material/assign_material.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/data.py b/src/ifcopenshell-python/ifcopenshell/api/material/data.py similarity index 96% rename from src/ifcblenderexport/blenderbim/bim/module/material/data.py rename to src/ifcopenshell-python/ifcopenshell/api/material/data.py index 26321ee2a3..1c39d5b20f 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/material/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/material/data.py @@ -1,5 +1,4 @@ import ifcopenshell -from blenderbim.bim.ifc import IfcStore class Data: @@ -31,8 +30,8 @@ class Data: cls._file = None @classmethod - def load(cls, product_id=None): - cls._file = IfcStore.get_file() + def load(cls, file, product_id=None): + cls._file = file if not cls._file: return if product_id: diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/edit_assigned_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/edit_assigned_material.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/edit_assigned_material.py rename to src/ifcopenshell-python/ifcopenshell/api/material/edit_assigned_material.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/edit_constituent.py b/src/ifcopenshell-python/ifcopenshell/api/material/edit_constituent.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/edit_constituent.py rename to src/ifcopenshell-python/ifcopenshell/api/material/edit_constituent.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/edit_layer.py b/src/ifcopenshell-python/ifcopenshell/api/material/edit_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/edit_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/material/edit_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/edit_profile.py b/src/ifcopenshell-python/ifcopenshell/api/material/edit_profile.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/edit_profile.py rename to src/ifcopenshell-python/ifcopenshell/api/material/edit_profile.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/remove_constituent.py b/src/ifcopenshell-python/ifcopenshell/api/material/remove_constituent.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/remove_constituent.py rename to src/ifcopenshell-python/ifcopenshell/api/material/remove_constituent.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/remove_layer.py b/src/ifcopenshell-python/ifcopenshell/api/material/remove_layer.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/remove_layer.py rename to src/ifcopenshell-python/ifcopenshell/api/material/remove_layer.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/remove_list_item.py b/src/ifcopenshell-python/ifcopenshell/api/material/remove_list_item.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/remove_list_item.py rename to src/ifcopenshell-python/ifcopenshell/api/material/remove_list_item.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/remove_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/remove_material.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/remove_material.py rename to src/ifcopenshell-python/ifcopenshell/api/material/remove_material.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/reorder_set_item.py b/src/ifcopenshell-python/ifcopenshell/api/material/reorder_set_item.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/reorder_set_item.py rename to src/ifcopenshell-python/ifcopenshell/api/material/reorder_set_item.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/material/unassign_material.py b/src/ifcopenshell-python/ifcopenshell/api/material/unassign_material.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/material/unassign_material.py rename to src/ifcopenshell-python/ifcopenshell/api/material/unassign_material.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/add_address.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_address.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/add_address.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/add_address.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/add_organisation.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/add_organisation.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/add_organisation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/add_person.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/add_person.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/add_person.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/add_role.py b/src/ifcopenshell-python/ifcopenshell/api/owner/add_role.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/add_role.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/add_role.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/api.py b/src/ifcopenshell-python/ifcopenshell/api/owner/api.py similarity index 91% rename from src/ifcblenderexport/blenderbim/bim/module/owner/api.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/api.py index b95d928b46..4eb7c32110 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/owner/api.py +++ b/src/ifcopenshell-python/ifcopenshell/api/owner/api.py @@ -1,8 +1,8 @@ import bpy import time import addon_utils -import blenderbim.bim.module.owner.create_owner_history as create_owner_history_usecase -import blenderbim.bim.module.owner.update_owner_history as update_owner_history_usecase +import ifcopenshell.api.owner.create_owner_history as create_owner_history_usecase +import ifcopenshell.api.owner.update_owner_history as update_owner_history_usecase from blenderbim.bim.ifc import IfcStore diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/create_owner_history.py b/src/ifcopenshell-python/ifcopenshell/api/owner/create_owner_history.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/create_owner_history.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/create_owner_history.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/data.py b/src/ifcopenshell-python/ifcopenshell/api/owner/data.py similarity index 95% rename from src/ifcblenderexport/blenderbim/bim/module/owner/data.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/data.py index 290becd1dd..d4aa5a3b4d 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/owner/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/owner/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False people = {} @@ -17,8 +14,7 @@ class Data: cls.roles = {} @classmethod - def load(cls): - file = IfcStore.get_file() + def load(cls, file): if not file: return cls.people = {} diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/edit_address.py b/src/ifcopenshell-python/ifcopenshell/api/owner/edit_address.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/edit_address.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/edit_address.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/edit_organisation.py b/src/ifcopenshell-python/ifcopenshell/api/owner/edit_organisation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/edit_organisation.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/edit_organisation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/edit_person.py b/src/ifcopenshell-python/ifcopenshell/api/owner/edit_person.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/edit_person.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/edit_person.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/edit_role.py b/src/ifcopenshell-python/ifcopenshell/api/owner/edit_role.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/edit_role.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/edit_role.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/remove_address.py b/src/ifcopenshell-python/ifcopenshell/api/owner/remove_address.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/remove_address.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/remove_address.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/remove_organisation.py b/src/ifcopenshell-python/ifcopenshell/api/owner/remove_organisation.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/remove_organisation.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/remove_organisation.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/remove_person.py b/src/ifcopenshell-python/ifcopenshell/api/owner/remove_person.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/remove_person.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/remove_person.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/remove_role.py b/src/ifcopenshell-python/ifcopenshell/api/owner/remove_role.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/remove_role.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/remove_role.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/owner/update_owner_history.py b/src/ifcopenshell-python/ifcopenshell/api/owner/update_owner_history.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/owner/update_owner_history.py rename to src/ifcopenshell-python/ifcopenshell/api/owner/update_owner_history.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/project/create_file.py b/src/ifcopenshell-python/ifcopenshell/api/project/create_file.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/project/create_file.py rename to src/ifcopenshell-python/ifcopenshell/api/project/create_file.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/add_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset/add_pset.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/add_pset.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/add_qto.py b/src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset/add_qto.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/add_qto.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/data.py b/src/ifcopenshell-python/ifcopenshell/api/pset/data.py similarity index 96% rename from src/ifcblenderexport/blenderbim/bim/module/pset/data.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/data.py index 4632a085be..9b1410fe77 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset/data.py @@ -1,7 +1,6 @@ import ifcopenshell import ifcopenshell.util.attribute import blenderbim.bim.schema # TODO: refactor elsewhere -from blenderbim.bim.ifc import IfcStore class Data: @@ -16,8 +15,9 @@ class Data: cls.qtos = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): + cls._file = file + cls._schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name(file.schema) if not file: return product = file.by_id(product_id) @@ -162,7 +162,7 @@ class Data: if prop_template.TemplateType == "P_SINGLEVALUE": try: data_type = ifcopenshell.util.attribute.get_primitive_type( - IfcStore.get_schema().declaration_by_name(prop_template.PrimaryMeasureType or "IfcLabel") + cls._schema.declaration_by_name(prop_template.PrimaryMeasureType or "IfcLabel") ) except: # TODO: Occurs if the data type is something that exists in IFC4 and not in IFC2X3. To fully fix diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/edit_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset/edit_pset.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/edit_pset.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/edit_qto.py b/src/ifcopenshell-python/ifcopenshell/api/pset/edit_qto.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset/edit_qto.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/edit_qto.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset/remove_pset.py b/src/ifcopenshell-python/ifcopenshell/api/pset/remove_pset.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset/remove_pset.py rename to src/ifcopenshell-python/ifcopenshell/api/pset/remove_pset.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/add_prop_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/add_prop_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/add_prop_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/add_prop_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/add_pset_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/add_pset_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/add_pset_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/add_pset_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/data.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/data.py similarity index 90% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/data.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/data.py index 6ff8bd6ba1..d3c9ccb040 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/pset_template/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/pset_template/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False pset_templates = {} @@ -13,8 +10,8 @@ class Data: cls.prop_templates = {} @classmethod - def load(cls): - cls._file = IfcStore.pset_template_file + def load(cls, file): + cls._file = file cls.pset_templates = {} cls.prop_templates = {} diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/edit_prop_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/edit_prop_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/edit_prop_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/edit_prop_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/edit_pset_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/edit_pset_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/edit_pset_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/edit_pset_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/remove_prop_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/remove_prop_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/remove_prop_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/remove_prop_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/pset_template/remove_pset_template.py b/src/ifcopenshell-python/ifcopenshell/api/pset_template/remove_pset_template.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/pset_template/remove_pset_template.py rename to src/ifcopenshell-python/ifcopenshell/api/pset_template/remove_pset_template.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/copy_class.py b/src/ifcopenshell-python/ifcopenshell/api/root/copy_class.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/root/copy_class.py rename to src/ifcopenshell-python/ifcopenshell/api/root/copy_class.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/create_product.py b/src/ifcopenshell-python/ifcopenshell/api/root/create_product.py similarity index 94% rename from src/ifcblenderexport/blenderbim/bim/module/root/create_product.py rename to src/ifcopenshell-python/ifcopenshell/api/root/create_product.py index 2a460df11b..ae74c11b52 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/root/create_product.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/create_product.py @@ -1,5 +1,5 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history +from ifcopenshell.api.owner.api import create_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/data.py b/src/ifcopenshell-python/ifcopenshell/api/root/data.py similarity index 81% rename from src/ifcblenderexport/blenderbim/bim/module/root/data.py rename to src/ifcopenshell-python/ifcopenshell/api/root/data.py index 445ece8e37..2fe987f5dc 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/root/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/root/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} @@ -9,8 +6,7 @@ class Data: cls.products = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return product = file.by_id(product_id) diff --git a/src/ifcblenderexport/blenderbim/bim/module/root/reassign_class.py b/src/ifcopenshell-python/ifcopenshell/api/root/reassign_class.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/root/reassign_class.py rename to src/ifcopenshell-python/ifcopenshell/api/root/reassign_class.py diff --git a/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py b/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py new file mode 100644 index 0000000000..cbb0269a1c --- /dev/null +++ b/src/ifcopenshell-python/ifcopenshell/api/root/remove_product.py @@ -0,0 +1,27 @@ +import ifcopenshell.api.geometry.unassign_representation as unassign_representation +import ifcopenshell.api.geometry.remove_representation as remove_representation + + +class Usecase: + def __init__(self, file, settings=None): + self.file = file + self.settings = {"product": None} + for key, value in settings.items(): + self.settings[key] = value + + def execute(self): + representations = [] + if self.settings["product"].is_a("IfcProduct"): + if self.settings["product"].Representation: + representations = self.settings["product"].Representation.Representations or [] + else: + representations = [] + elif self.settings["product"].is_a("IfcTypeProduct"): + representations = [rm.MappedRepresentation for rm in self.settings["product"].RepresentationMaps or []] + for representation in representations: + unassign_representation.Usecase( + self.file, {"product": self.settings["product"], "representation": representation} + ).execute() + remove_representation.Usecase(self.file, {"representation": representation}).execute() + # TODO: remove object placement and other relationships + self.file.remove(self.settings["product"]) diff --git a/src/ifcblenderexport/blenderbim/bim/module/sequence/data.py b/src/ifcopenshell-python/ifcopenshell/api/sequence/data.py similarity index 71% rename from src/ifcblenderexport/blenderbim/bim/module/sequence/data.py rename to src/ifcopenshell-python/ifcopenshell/api/sequence/data.py index dd7dc98e98..3f36e85843 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/sequence/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/sequence/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False tasks = {} @@ -11,8 +8,8 @@ class Data: cls.tasks = {} @classmethod - def load(cls): + def load(cls, file): cls.tasks = {} - for task in IfcStore.get_file().by_type("IfcTask"): + for task in file.by_type("IfcTask"): cls.tasks[task.id()] = {"Name": task.Name, "Identification": task.Identification or ""} cls.is_loaded=True diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/assign_container.py b/src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/spatial/assign_container.py rename to src/ifcopenshell-python/ifcopenshell/api/spatial/assign_container.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/data.py b/src/ifcopenshell-python/ifcopenshell/api/spatial/data.py similarity index 83% rename from src/ifcblenderexport/blenderbim/bim/module/spatial/data.py rename to src/ifcopenshell-python/ifcopenshell/api/spatial/data.py index 027edea27f..03118e0ab0 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/spatial/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/spatial/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} spatial_elements = {} @@ -11,14 +8,13 @@ class Data: cls.spatial_elements = {} @classmethod - def load(cls, product_id=None): + def load(cls, file, product_id=None): if product_id: - return cls.load_product(product_id) - cls.load_spatial_elements() + return cls.load_product(file, product_id) + cls.load_spatial_elements(file) @classmethod - def load_product(cls, product_id): - file = IfcStore.get_file() + def load_product(cls, file, product_id): if not file: return product = file.by_id(product_id) @@ -31,8 +27,7 @@ class Data: cls.products[product_id] = {"type": None, "Name": None, "id": None} @classmethod - def load_spatial_elements(cls): - file = IfcStore.get_file() + def load_spatial_elements(cls, file): if not file: return cls.spatial_elements = {} diff --git a/src/ifcblenderexport/blenderbim/bim/module/spatial/remove_container.py b/src/ifcopenshell-python/ifcopenshell/api/spatial/remove_container.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/spatial/remove_container.py rename to src/ifcopenshell-python/ifcopenshell/api/spatial/remove_container.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/add_structural_analysis_model.py b/src/ifcopenshell-python/ifcopenshell/api/structural/add_structural_analysis_model.py similarity index 88% rename from src/ifcblenderexport/blenderbim/bim/module/structural/add_structural_analysis_model.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/add_structural_analysis_model.py index f7539c02ed..1f2adca6f0 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/add_structural_analysis_model.py +++ b/src/ifcopenshell-python/ifcopenshell/api/structural/add_structural_analysis_model.py @@ -1,5 +1,5 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history +from ifcopenshell.api.owner.api import create_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/add_structural_boundary_condition.py b/src/ifcopenshell-python/ifcopenshell/api/structural/add_structural_boundary_condition.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/structural/add_structural_boundary_condition.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/add_structural_boundary_condition.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/assign_structural_analysis_model.py b/src/ifcopenshell-python/ifcopenshell/api/structural/assign_structural_analysis_model.py similarity index 88% rename from src/ifcblenderexport/blenderbim/bim/module/structural/assign_structural_analysis_model.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/assign_structural_analysis_model.py index ff486b3fbf..ee619d87dc 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/assign_structural_analysis_model.py +++ b/src/ifcopenshell-python/ifcopenshell/api/structural/assign_structural_analysis_model.py @@ -1,6 +1,6 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import create_owner_history -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import create_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/data.py b/src/ifcopenshell-python/ifcopenshell/api/structural/data.py similarity index 90% rename from src/ifcblenderexport/blenderbim/bim/module/structural/data.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/data.py index dfe1265db4..c8bc9d5404 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/structural/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False products = {} @@ -16,7 +13,8 @@ class Data: cls.structural_analysis_models = {} @classmethod - def load(cls, product_id=None): + def load(cls, file, product_id=None): + cls._file = file if product_id: cls.boundary_conditions = {} return cls.load_structural_connection(product_id) @@ -27,7 +25,7 @@ class Data: @classmethod def load_structural_analysis_models(cls): - for model in IfcStore.get_file().by_type("IfcStructuralAnalysisModel"): + for model in cls._file.by_type("IfcStructuralAnalysisModel"): if model.IsGroupedBy: for rel in model.IsGroupedBy: for product in rel.RelatedObjects: @@ -50,7 +48,7 @@ class Data: @classmethod def load_structural_connection(cls, product_id): - connection = IfcStore.get_file().by_id(product_id) + connection = cls._file.by_id(product_id) if connection.AppliedCondition: data = connection.AppliedCondition.get_info() for key, value in data.items(): diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/edit_structural_analysis_model.py b/src/ifcopenshell-python/ifcopenshell/api/structural/edit_structural_analysis_model.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/structural/edit_structural_analysis_model.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/edit_structural_analysis_model.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/edit_structural_boundary_condition.py b/src/ifcopenshell-python/ifcopenshell/api/structural/edit_structural_boundary_condition.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/structural/edit_structural_boundary_condition.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/edit_structural_boundary_condition.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/remove_structural_analysis_model.py b/src/ifcopenshell-python/ifcopenshell/api/structural/remove_structural_analysis_model.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/structural/remove_structural_analysis_model.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/remove_structural_analysis_model.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/remove_structural_boundary_condition.py b/src/ifcopenshell-python/ifcopenshell/api/structural/remove_structural_boundary_condition.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/structural/remove_structural_boundary_condition.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/remove_structural_boundary_condition.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/structural/unassign_structural_analysis_model.py b/src/ifcopenshell-python/ifcopenshell/api/structural/unassign_structural_analysis_model.py similarity index 92% rename from src/ifcblenderexport/blenderbim/bim/module/structural/unassign_structural_analysis_model.py rename to src/ifcopenshell-python/ifcopenshell/api/structural/unassign_structural_analysis_model.py index 0f1b49290e..b2c367a2d5 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/structural/unassign_structural_analysis_model.py +++ b/src/ifcopenshell-python/ifcopenshell/api/structural/unassign_structural_analysis_model.py @@ -1,5 +1,5 @@ import ifcopenshell -from blenderbim.bim.module.owner.api import update_owner_history +from ifcopenshell.api.owner.api import update_owner_history class Usecase: diff --git a/src/ifcblenderexport/blenderbim/bim/module/style/add_style.py b/src/ifcopenshell-python/ifcopenshell/api/style/add_style.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/style/add_style.py rename to src/ifcopenshell-python/ifcopenshell/api/style/add_style.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/style/edit_style.py b/src/ifcopenshell-python/ifcopenshell/api/style/edit_style.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/style/edit_style.py rename to src/ifcopenshell-python/ifcopenshell/api/style/edit_style.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/assign_type.py b/src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/type/assign_type.py rename to src/ifcopenshell-python/ifcopenshell/api/type/assign_type.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/data.py b/src/ifcopenshell-python/ifcopenshell/api/type/data.py similarity index 91% rename from src/ifcblenderexport/blenderbim/bim/module/type/data.py rename to src/ifcopenshell-python/ifcopenshell/api/type/data.py index 696db35582..ac8cd509aa 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/type/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/type/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} @@ -9,8 +6,7 @@ class Data: cls.products = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return product = file.by_id(product_id) diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/get_related_objects.py b/src/ifcopenshell-python/ifcopenshell/api/type/get_related_objects.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/type/get_related_objects.py rename to src/ifcopenshell-python/ifcopenshell/api/type/get_related_objects.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/type/unassign_type.py b/src/ifcopenshell-python/ifcopenshell/api/type/unassign_type.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/type/unassign_type.py rename to src/ifcopenshell-python/ifcopenshell/api/type/unassign_type.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/unit/assign_unit.py b/src/ifcopenshell-python/ifcopenshell/api/unit/assign_unit.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/unit/assign_unit.py rename to src/ifcopenshell-python/ifcopenshell/api/unit/assign_unit.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/unit/data.py b/src/ifcopenshell-python/ifcopenshell/api/unit/data.py similarity index 82% rename from src/ifcblenderexport/blenderbim/bim/module/unit/data.py rename to src/ifcopenshell-python/ifcopenshell/api/unit/data.py index 08e1198d55..8b71dad1b4 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/unit/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/unit/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: is_loaded = False units = {} @@ -11,8 +8,7 @@ class Data: cls.units = {} @classmethod - def load(cls): - file = IfcStore.get_file() + def load(cls, file): if not file: return unit_assignment = file.by_type("IfcUnitAssignment") diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/add_filling.py b/src/ifcopenshell-python/ifcopenshell/api/void/add_filling.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/void/add_filling.py rename to src/ifcopenshell-python/ifcopenshell/api/void/add_filling.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/add_opening.py b/src/ifcopenshell-python/ifcopenshell/api/void/add_opening.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/void/add_opening.py rename to src/ifcopenshell-python/ifcopenshell/api/void/add_opening.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/data.py b/src/ifcopenshell-python/ifcopenshell/api/void/data.py similarity index 95% rename from src/ifcblenderexport/blenderbim/bim/module/void/data.py rename to src/ifcopenshell-python/ifcopenshell/api/void/data.py index 84c80f3fb0..1f8da638ee 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/void/data.py +++ b/src/ifcopenshell-python/ifcopenshell/api/void/data.py @@ -1,6 +1,3 @@ -from blenderbim.bim.ifc import IfcStore - - class Data: products = {} openings = {} @@ -13,8 +10,7 @@ class Data: cls.fillings = {} @classmethod - def load(cls, product_id): - file = IfcStore.get_file() + def load(cls, file, product_id): if not file: return cls.products[product_id] = set() diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/remove_filling.py b/src/ifcopenshell-python/ifcopenshell/api/void/remove_filling.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/void/remove_filling.py rename to src/ifcopenshell-python/ifcopenshell/api/void/remove_filling.py diff --git a/src/ifcblenderexport/blenderbim/bim/module/void/remove_opening.py b/src/ifcopenshell-python/ifcopenshell/api/void/remove_opening.py similarity index 100% rename from src/ifcblenderexport/blenderbim/bim/module/void/remove_opening.py rename to src/ifcopenshell-python/ifcopenshell/api/void/remove_opening.py