From 4a4a0f09ef2b9d514add007123abfd13d9e43295 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 22 Sep 2023 17:04:11 +1000 Subject: [PATCH] Finally purge IfcCOBie to be superseded by IfcFM --- README.md | 1 - src/blenderbim/blenderbim/bim/__init__.py | 1 - .../blenderbim/bim/module/cobie/__init__.py | 36 - .../blenderbim/bim/module/cobie/operator.py | 124 -- .../blenderbim/bim/module/cobie/prop.py | 38 - .../blenderbim/bim/module/cobie/ui.py | 63 - src/ifccobie/COPYING | 621 ------ src/ifccobie/COPYING.LESSER | 165 -- src/ifccobie/cobie.py | 1667 ----------------- src/ifccobie/get_maintainable_assets.py | 79 - src/ifccobie/icon.ico | Bin 104035 -> 0 bytes 11 files changed, 2795 deletions(-) delete mode 100644 src/blenderbim/blenderbim/bim/module/cobie/__init__.py delete mode 100644 src/blenderbim/blenderbim/bim/module/cobie/operator.py delete mode 100644 src/blenderbim/blenderbim/bim/module/cobie/prop.py delete mode 100644 src/blenderbim/blenderbim/bim/module/cobie/ui.py delete mode 100644 src/ifccobie/COPYING delete mode 100644 src/ifccobie/COPYING.LESSER delete mode 100755 src/ifccobie/cobie.py delete mode 100644 src/ifccobie/get_maintainable_assets.py delete mode 100644 src/ifccobie/icon.ico diff --git a/README.md b/README.md index e9416797e8..e8670871c8 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,6 @@ Those marked with an asterisk are part of IfcOpenShell. | ifcblender | Historic Blender IFC import add-on | LGPL-3.0-or-later\* | | ifccityjson | Convert CityJSON to IFC | LGPL-3.0-or-later | | ifcclash | Clash detection library and CLI app | LGPL-3.0-or-later | -| ifccobie | Extract IFC data for COBie handover requirements | LGPL-3.0-or-later | | ifcconvert | CLI app to convert IFC to many other formats | LGPL-3.0-or-later\* | | ifccsv | Library and CLI app to export and import schedules from IFC | LGPL-3.0-or-later | | ifcdiff | Compare changes between IFC models | LGPL-3.0-or-later | diff --git a/src/blenderbim/blenderbim/bim/__init__.py b/src/blenderbim/blenderbim/bim/__init__.py index c21240c12b..9528ab8869 100644 --- a/src/blenderbim/blenderbim/bim/__init__.py +++ b/src/blenderbim/blenderbim/bim/__init__.py @@ -46,7 +46,6 @@ modules = { "aggregate": None, "geometry": None, "fm": None, - "cobie": None, "resource": None, "cost": None, "sequence": None, diff --git a/src/blenderbim/blenderbim/bim/module/cobie/__init__.py b/src/blenderbim/blenderbim/bim/module/cobie/__init__.py deleted file mode 100644 index a1ad500ae2..0000000000 --- a/src/blenderbim/blenderbim/bim/module/cobie/__init__.py +++ /dev/null @@ -1,36 +0,0 @@ -# BlenderBIM Add-on - OpenBIM Blender Add-on -# Copyright (C) 2020, 2021 Dion Moult -# -# This file is part of BlenderBIM Add-on. -# -# BlenderBIM Add-on is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BlenderBIM Add-on is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BlenderBIM Add-on. If not, see . - -import bpy -from . import ui, prop, operator - -classes = ( - operator.SelectCobieIfcFile, - operator.SelectCobieJsonFile, - operator.ExecuteIfcCobie, - prop.COBieProperties, - ui.BIM_PT_cobie, -) - - -def register(): - bpy.types.Scene.COBieProperties = bpy.props.PointerProperty(type=prop.COBieProperties) - - -def unregister(): - del bpy.types.Scene.COBieProperties diff --git a/src/blenderbim/blenderbim/bim/module/cobie/operator.py b/src/blenderbim/blenderbim/bim/module/cobie/operator.py deleted file mode 100644 index 3f1a512116..0000000000 --- a/src/blenderbim/blenderbim/bim/module/cobie/operator.py +++ /dev/null @@ -1,124 +0,0 @@ -# BlenderBIM Add-on - OpenBIM Blender Add-on -# Copyright (C) 2020, 2021 Dion Moult -# -# This file is part of BlenderBIM Add-on. -# -# BlenderBIM Add-on is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BlenderBIM Add-on is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BlenderBIM Add-on. If not, see . - -import bpy -import os -import logging -import ifcopenshell -import json -import webbrowser -import tempfile -from blenderbim.bim.ifc import IfcStore - - -class SelectCobieIfcFile(bpy.types.Operator): - bl_idname = "bim.select_cobie_ifc_file" - bl_label = "Select COBie IFC File" - bl_options = {"REGISTER", "UNDO"} - filepath: bpy.props.StringProperty(subtype="FILE_PATH") - - def execute(self, context): - context.scene.COBieProperties.cobie_ifc_file = self.filepath - return {"FINISHED"} - - def invoke(self, context, event): - context.window_manager.fileselect_add(self) - return {"RUNNING_MODAL"} - - -class SelectCobieJsonFile(bpy.types.Operator): - bl_idname = "bim.select_cobie_json_file" - bl_label = "Select COBie JSON File" - bl_options = {"REGISTER", "UNDO"} - filepath: bpy.props.StringProperty(subtype="FILE_PATH") - - def execute(self, context): - context.scene.COBieProperties.cobie_json_file = self.filepath - return {"FINISHED"} - - def invoke(self, context, event): - context.window_manager.fileselect_add(self) - return {"RUNNING_MODAL"} - - -class ExecuteIfcCobie(bpy.types.Operator): - bl_idname = "bim.execute_ifc_cobie" - bl_label = "Execute IFCCOBie" - file_format: bpy.props.StringProperty() - - @classmethod - def poll(cls, context): - props = context.scene.COBieProperties - return props.should_load_from_memory or props.cobie_ifc_file - - def execute(self, context): - from cobie import IfcCobieParser - - props = context.scene.COBieProperties - - if props.should_load_from_memory: - output_dir = tempfile.gettempdir() - else: - output_dir = os.path.dirname(props.cobie_ifc_file) - - output = os.path.join(output_dir, "output") - logger = logging.getLogger("IFCtoCOBie") - fh = logging.FileHandler(os.path.join(output_dir, "cobie.log")) - fh.setLevel(logging.DEBUG) - fh.setFormatter(logging.Formatter("%(asctime)s : %(levelname)s : %(message)s")) - logger = logging.getLogger("IFCtoCOBie") - logger.addHandler(fh) - selector = ifcopenshell.util.selector.Selector() - if props.cobie_json_file: - with open(props.cobie_json_file, "r") as f: - custom_data = json.load(f) - else: - custom_data = {} - parser = IfcCobieParser(logger, selector) - - ifc_file = IfcStore.get_file() - - if not (ifc_file and props.should_load_from_memory): - ifc_file = props.cobie_ifc_file - - parser.parse( - ifc_file, - props.cobie_types, - props.cobie_components, - custom_data, - ) - if self.file_format == "xlsx": - from cobie import CobieXlsWriter - - writer = CobieXlsWriter(parser, output) - writer.write() - webbrowser.open("file://" + output + "." + self.file_format) - elif self.file_format == "ods": - from cobie import CobieOdsWriter - - writer = CobieOdsWriter(parser, output) - writer.write() - webbrowser.open("file://" + output + "." + self.file_format) - else: - from cobie import CobieCsvWriter - - writer = CobieCsvWriter(parser, output_dir) - writer.write() - webbrowser.open("file://" + output_dir) - webbrowser.open("file://" + output_dir + "/cobie.log") - return {"FINISHED"} diff --git a/src/blenderbim/blenderbim/bim/module/cobie/prop.py b/src/blenderbim/blenderbim/bim/module/cobie/prop.py deleted file mode 100644 index 567a0f9960..0000000000 --- a/src/blenderbim/blenderbim/bim/module/cobie/prop.py +++ /dev/null @@ -1,38 +0,0 @@ -# BlenderBIM Add-on - OpenBIM Blender Add-on -# Copyright (C) 2020, 2021 Dion Moult -# -# This file is part of BlenderBIM Add-on. -# -# BlenderBIM Add-on is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BlenderBIM Add-on is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BlenderBIM Add-on. If not, see . - -import bpy -from bpy.types import PropertyGroup -from bpy.props import ( - PointerProperty, - StringProperty, - EnumProperty, - BoolProperty, - IntProperty, - FloatProperty, - FloatVectorProperty, - CollectionProperty, -) - - -class COBieProperties(PropertyGroup): - cobie_ifc_file: StringProperty(default="", name="COBie IFC File") - cobie_types: StringProperty(default=".COBieType", name="COBie Types") - cobie_components: StringProperty(default=".COBie", name="COBie Components") - cobie_json_file: StringProperty(default="", name="COBie JSON File") - should_load_from_memory: BoolProperty(default=False, name="Load from Memory") diff --git a/src/blenderbim/blenderbim/bim/module/cobie/ui.py b/src/blenderbim/blenderbim/bim/module/cobie/ui.py deleted file mode 100644 index a78cff2b62..0000000000 --- a/src/blenderbim/blenderbim/bim/module/cobie/ui.py +++ /dev/null @@ -1,63 +0,0 @@ -# BlenderBIM Add-on - OpenBIM Blender Add-on -# Copyright (C) 2020, 2021 Dion Moult -# -# This file is part of BlenderBIM Add-on. -# -# BlenderBIM Add-on is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# BlenderBIM Add-on is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with BlenderBIM Add-on. If not, see . - -import blenderbim.tool as tool -from bpy.types import Panel -from blenderbim.bim.ifc import IfcStore - - -class BIM_PT_cobie(Panel): - bl_label = "COBie" - bl_idname = "BIM_PT_cobie" - bl_space_type = "PROPERTIES" - bl_region_type = "WINDOW" - bl_context = "scene" - bl_parent_id = "BIM_PT_tab_handover" - - def draw(self, context): - layout = self.layout - layout.use_property_split = True - - scene = context.scene - props = scene.COBieProperties - - if IfcStore.get_file(): - row = layout.row() - row.prop(props, "should_load_from_memory") - - if not IfcStore.get_file() or not props.should_load_from_memory: - row = layout.row(align=True) - row.prop(props, "cobie_ifc_file") - row.operator("bim.select_cobie_ifc_file", icon="FILE_FOLDER", text="") - - row = layout.row() - row.prop(props, "cobie_types") - row = layout.row() - row.prop(props, "cobie_components") - - row = layout.row(align=True) - row.prop(props, "cobie_json_file") - row.operator("bim.select_cobie_json_file", icon="FILE_FOLDER", text="") - - row = layout.row() - op = row.operator("bim.execute_ifc_cobie", text="CSV") - op.file_format = "csv" - op = row.operator("bim.execute_ifc_cobie", text="ODS") - op.file_format = "ods" - op = row.operator("bim.execute_ifc_cobie", text="XLSX") - op.file_format = "xlsx" diff --git a/src/ifccobie/COPYING b/src/ifccobie/COPYING deleted file mode 100644 index 810fce6e9b..0000000000 --- a/src/ifccobie/COPYING +++ /dev/null @@ -1,621 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS diff --git a/src/ifccobie/COPYING.LESSER b/src/ifccobie/COPYING.LESSER deleted file mode 100644 index 0a041280bd..0000000000 --- a/src/ifccobie/COPYING.LESSER +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/src/ifccobie/cobie.py b/src/ifccobie/cobie.py deleted file mode 100755 index c5cde601eb..0000000000 --- a/src/ifccobie/cobie.py +++ /dev/null @@ -1,1667 +0,0 @@ -#!/usr/bin/env python3 - -# IfcCOBie - Extract COBie data from IFC to spreadsheets -# Copyright (C) 2019, 2020, 2021 Dion Moult -# -# This file is part of IfcCOBie. -# -# IfcCOBie is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# IfcCOBie is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with IfcCOBie. If not, see . - -# This can be packaged with `pyinstaller --onefile --clean --icon=icon.ico bimtester.py` - -import os -import time -import argparse -import datetime -import logging -import ifcopenshell -import ifcopenshell.util.selector -import ifcopenshell.util.placement - - -class IfcCobieParser: - def __init__(self, logger, selector): - self.selector = selector - self.logger = logger - self.file = None - self.sheets = [ - "contacts", - "facilities", - "floors", - "spaces", - "zones", - "types", - "components", - "systems", - "assemblies", - "connections", - "spares", - "resources", - "jobs", - "impacts", - "documents", - "attributes", - "coordinates", - "issues", - ] - for sheet in self.sheets: - setattr(self, sheet, {}) - self.picklists = { - "Category-Role": [], - "Category-Facility": [], - "FloorType": [], - "Category-Space": [], - "ZoneType": [], - "Category-Product": [], - "AssetType": [], - "DurationUnit": ["day"], # See note about hardcoded day below - "Category-Element": [], - "SpareType": [], - "ApprovalBy": [], - "StageType": [], - "objType": [], - } - self.default_date = (datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=-2177452801)).isoformat() - - def parse(self, file, type_query=".COBieType", component_query=".COBie", custom_data={}): - self.custom_data = custom_data - for sheet in self.sheets: - if sheet not in self.custom_data: - self.custom_data[sheet] = {} - - if isinstance(file, str): - self.file = ifcopenshell.open(file) - else: - self.file = file - - self.type_assets = self.selector.parse(self.file, type_query) - self.component_assets = self.selector.parse(self.file, component_query) - self.get_contacts() - self.get_facilities() - self.get_floors() - self.get_spaces() - self.get_zones() - self.get_types() - self.get_components() - self.get_systems() - self.get_assemblies() - self.get_connections() - self.get_spares() - self.get_resources() - self.get_jobs() - self.get_impacts() - self.get_documents() - self.get_attributes() - self.get_coordinates() - self.get_issues() - - def get_contacts(self): - histories = self.file.by_type("IfcOwnerHistory") - for history in histories: - email = self.get_email_from_history(history) - if not email: - continue - postal_address = self.get_postal_address_from_history(history) - self.contacts[email] = { - "CreatedBy": email, - "CreatedOn": datetime.datetime.fromtimestamp(history.CreationDate).isoformat() - if history.CreationDate - else datetime.datetime.now().isoformat(), - "Category": self.get_category_from_history(history), - "Company": history.OwningUser.TheOrganization.Name or "n/a", - "Phone": self.get_phone_from_history(history), - "ExtSystem": self.get_ext_system_from_history(history), - "ExtObject": self.get_ext_object_from_history(history), - "ExtIdentifier": history.OwningUser.ThePerson.Id - if self.file.schema == "IFC2X3" - else history.OwningUser.ThePerson.Identification, - "Department": self.get_department_from_history(history), - "OrganizationCode": (history.OwningUser.TheOrganization.Id or "n/a") - if self.file.schema == "IFC2X3" - else (history.OwningUser.TheOrganization.Identification or "n/a"), - "GivenName": self.get_name_from_person(history.OwningUser.ThePerson, "GivenName"), - "FamilyName": self.get_name_from_person(history.OwningUser.ThePerson, "FamilyName"), - "Street": self.get_lines_from_address(postal_address), - "PostalBox": self.get_attribute_from_address(postal_address, "PostalBox"), - "Town": self.get_attribute_from_address(postal_address, "Town"), - "StateRegion": self.get_attribute_from_address(postal_address, "Region"), - "PostalCode": self.get_attribute_from_address(postal_address, "PostalCode"), - "Country": self.get_attribute_from_address(postal_address, "Country"), - } - for field, key in self.custom_data["contacts"].items(): - self.contacts[email][field] = self.get_element_value(history, key) - - def get_facilities(self): - buildings = self.file.by_type("IfcBuilding") - for building in buildings: - building_name = self.get_object_name(building) - units = self.get_units_from_building(building) - self.facilities[building_name] = { - "CreatedBy": self.get_email_from_history(building.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(building.OwnerHistory), - "Category": self.get_category_from_object(building, "Category-Facility"), - "ProjectName": self.get_project_name_from_building(building), - "SiteName": self.get_site_name_from_building(building), - "LinearUnits": self.get_unit_type_from_units(units, "LENGTHUNIT"), - "AreaUnits": self.get_unit_type_from_units(units, "AREAUNIT"), - "VolumeUnits": self.get_unit_type_from_units(units, "VOLUMEUNIT"), - "CostUnit": self.get_monetary_unit_from_units(units), - "AreaMeasurement": self.get_area_measurement_from_building(building), - "ExternalSystem": self.get_ext_system_from_history(building.OwnerHistory), - "ExternalProjectObject": self.get_ext_project_object(), - "ExternalProjectIdentifier": self.get_project_globalid_from_building(building), - "ExternalSiteObject": self.get_ext_site_object(), - "ExternalSiteIdentifier": self.get_site_globalid_from_building(building), - "ExternalFacilityObject": self.get_ext_object(building), - "ExternalFacilityIdentifier": building.GlobalId, - "Description": self.get_object_attribute(building, "Description", default="n/a"), - "ProjectDescription": self.get_object_attribute( - self.get_parent_spatial_element(building, "IfcProject"), "Description", default="n/a" - ), - "SiteDescription": self.get_object_attribute( - self.get_parent_spatial_element(building, "IfcSite"), "Description", default="n/a" - ), - "Phase": self.get_object_attribute( - self.get_parent_spatial_element(building, "IfcProject"), "Phase", default="n/a" - ), - } - for field, key in self.custom_data["facilities"].items(): - self.facilities[building_name][field] = self.get_element_value(building, key) - - def get_floors(self): - storeys = self.file.by_type("IfcBuildingStorey") - for storey in storeys: - storey_name = self.get_object_name(storey) - self.floors[storey_name] = { - "CreatedBy": self.get_email_from_history(storey.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(storey.OwnerHistory), - "Category": self.get_category_from_object(storey, "FloorType"), - "ExtSystem": self.get_ext_system_from_history(storey.OwnerHistory), - "ExtObject": self.get_ext_object(storey), - "ExtIdentifier": storey.GlobalId, - "Description": self.get_object_attribute(storey, "Description", default="n/a"), - "Elevation": self.get_object_attribute(storey, "Elevation", default="n/a"), - "Height": self.get_height_from_storey(storey), - } - for field, key in self.custom_data["floors"].items(): - self.floors[storey_name][field] = self.get_element_value(storey, key) - - def get_spaces(self): - spaces = self.file.by_type("IfcSpace") - for space in spaces: - space_name = self.get_object_name(space) - self.spaces[space_name] = { - "CreatedBy": self.get_email_from_history(space.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(space.OwnerHistory), - "Category": self.get_category_from_object(space, "Category-Space"), - "FloorName": self.get_object_attribute( - self.get_parent_spatial_element(space, "IfcBuildingStorey"), - "Name", - is_primary_key=True, - default="n/a", - ), - "Description": self.get_object_attribute(space, "Description", default="n/a"), - "ExtSystem": self.get_ext_system_from_history(space.OwnerHistory), - "ExtObject": self.get_ext_object(space), - "ExtIdentifier": space.GlobalId, - "RoomTag": self.get_pset_value_from_object(space, "COBie_Space", "RoomTag", "n/a"), - "UsableHeight": self.get_usable_height_from_space(space), - "GrossArea": self.get_gross_area_from_space(space), - "NetArea": self.get_net_area_from_space(space), - } - for field, key in self.custom_data["spaces"].items(): - self.spaces[space_name][field] = self.get_element_value(space, key) - - def get_zones(self): - zones = self.file.by_type("IfcZone") - for zone in zones: - zone_name = self.get_object_name(zone) - self.zones[zone_name] = { - "CreatedBy": self.get_email_from_history(zone.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(zone.OwnerHistory), - "Category": self.get_category_from_object(zone, "ZoneType"), - "SpaceNames": self.get_grouped_product_names_from_object(zone, "IfcSpace"), - "ExtSystem": self.get_ext_system_from_history(zone.OwnerHistory), - "ExtObject": self.get_ext_object(zone), - "ExtIdentifier": zone.GlobalId, - "Description": self.get_object_attribute(zone, "Description", default="n/a"), - } - for field, key in self.custom_data["zones"].items(): - self.zones[zone_name][field] = self.get_element_value(zone, key) - - def get_types(self): - types = self.file.by_type("IfcTypeObject") - for type in self.type_assets: - # The responsibility matrix states to parse IfcMaterial and - # IfcMaterialLayerSet too, but it doesn't make much sense, so I - # don't parse it. - type_name = self.get_object_name(type) - self.types[type_name] = { - "CreatedBy": self.get_email_from_history(type.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(type.OwnerHistory), - "Category": self.get_category_from_object(type, "Category-Product"), - # The responsibility matrix states two possible fallbacks. I - # choose the 'n/a' option as opposed to repeating the name. - "Description": self.get_object_attribute(type, "Description", default="n/a"), - "AssetType": self.get_pset_value_from_object(type, "COBie_Asset", "AssetType", "n/a", "AssetType"), - "Manufacturer": self.get_contact_pset_value_from_object( - type, "Pset_ManufacturerTypeInformation", "Manufacturer" - ), - "ModelNumber": self.get_pset_value_from_object( - type, "Pset_ManufacturerTypeInformation", "ModelLabel", "n/a" - ), - # The responsibility matrix talks about using the Pset_Warranty - # values, but Pset_Warranty only applies to objects, not types, - # and so they are ignored. - "WarrantyGuarantorParts": self.get_contact_pset_value_from_object( - type, "COBie_Warranty", "WarrantyGuarantorParts" - ), - "WarrantyDurationParts": self.get_pset_value_from_object( - type, "COBie_Warranty", "WarrantyDurationParts", 0 - ), - "WarrantyGuarantorLabor": self.get_contact_pset_value_from_object( - type, "COBie_Warranty", "WarrantyGuarantorLabor" - ), - "WarrantyDurationLabor": self.get_pset_value_from_object( - type, "COBie_Warranty", "WarrantyDurationLabor", 0 - ), - # TODO: this may be derived from the duration values above, but - # until it is clarified, it will be hardcoded as 'day' - "WarrantyDurationUnit": "day", - "ExtSystem": self.get_ext_system_from_history(type.OwnerHistory), - "ExtObject": self.get_ext_object(type), - "ExtIdentifier": type.GlobalId, - "ReplacementCost": self.get_pset_value_from_object( - type, "COBie_EconomicImpactValues", "ReplacementCost", "n/a" - ), - "ExpectedLife": self.get_expected_life_from_type(type), - # See note about WarrantyDurationUnit above - "DurationUnit": "day", - "NominalLength": self.get_pset_value_from_object(type, "COBie_Specification", "NominalLength", 0), - "NominalWidth": self.get_pset_value_from_object(type, "COBie_Specification", "NominalWidth", 0), - "NominalHeight": self.get_pset_value_from_object(type, "COBie_Specification", "NominalHeight", 0), - "ModelReference": self.get_pset_value_from_object( - type, "Pset_ManufacturerTypeInformation", "ModelReference", "n/a" - ), - "Shape": self.get_pset_value_from_object(type, "COBie_Specification", "Shape", "n/a"), - "Size": self.get_pset_value_from_object(type, "COBie_Specification", "Size", "n/a"), - # The responsbility matrix allows the British spelling of - # "colour". I, however, do not. - "Color": self.get_pset_value_from_object(type, "COBie_Specification", "Color", "n/a"), - "Finish": self.get_pset_value_from_object(type, "COBie_Specification", "Finish", "n/a"), - "Grade": self.get_pset_value_from_object(type, "COBie_Specification", "Grade", "n/a"), - "Material": self.get_pset_value_from_object(type, "COBie_Specification", "Material", "n/a"), - "Constituents": self.get_pset_value_from_object(type, "COBie_Specification", "Constituents", "n/a"), - "Features": self.get_pset_value_from_object(type, "COBie_Specification", "Features", "n/a"), - "AccessibilityPerformance": self.get_pset_value_from_object( - type, "COBie_Specification", "AccessibilityPerformance", "n/a" - ), - "CodePerformance": self.get_pset_value_from_object( - type, "COBie_Specification", "CodePerformance", "n/a" - ), - "SustainabilityPerformance": self.get_pset_value_from_object( - type, "COBie_Specification", "SustainabilityPerformance", "n/a" - ), - } - for field, key in self.custom_data["types"].items(): - self.types[type_name][field] = self.get_element_value(type, key) - - def get_components(self): - components = self.file.by_type("IfcElement") - for component in components: - if not self.is_object_a_component_asset(component): - self.logger.warning("A component which is not an asset was found for %s", component) - continue - component_name = self.get_object_name(component) - self.components[component_name] = { - "CreatedBy": self.get_email_from_history(component.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(component.OwnerHistory), - "TypeName": self.get_type_name_from_object(component), - "Space": self.get_space_name_from_component(component), - "Description": self.get_object_attribute(component, "Description", default="n/a"), - "ExtSystem": self.get_ext_system_from_history(component.OwnerHistory), - "ExtObject": self.get_ext_object(component), - "ExtIdentifier": component.GlobalId, - "SerialNumber": self.get_pset_value_from_object( - component, "Pset_ManufacturerOccurence", "SerialNumber", "n/a" - ), - "InstallationDate": self.get_pset_value_from_object( - component, "COBie_Component", "InstallationDate", self.default_date - ), - "WarrantyStartDate": self.get_pset_value_from_object( - component, "COBie_Component", "WarrantyStartDate", self.default_date - ), - "TagNumber": self.get_pset_value_from_object(component, "COBie_Component", "TagNumber", "n/a"), - "BarCode": self.get_pset_value_from_object(component, "Pset_ManufacturerOccurence", "BarCode", "n/a"), - "AssetIdentifier": self.get_pset_value_from_object( - component, "COBie_Component", "AssetIdentifier", "n/a" - ), - } - for field, key in self.custom_data["components"].items(): - self.components[component_name][field] = self.get_element_value(component, key) - - def get_systems(self): - systems = self.file.by_type("IfcSystem") - for system in systems: - system_name = self.get_object_name(system) - self.systems[system_name] = { - "CreatedBy": self.get_email_from_history(system.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(system.OwnerHistory), - "Category": self.get_category_from_object(system, "Category-Element"), - "ComponentNames": self.get_grouped_product_names_from_object(system, "IfcProduct"), - "ExtSystem": self.get_ext_system_from_history(system.OwnerHistory), - "ExtObject": self.get_ext_object(system), - "ExtIdentifier": system.GlobalId, - "Description": self.get_object_attribute(system, "Description", default="n/a"), - } - for field, key in self.custom_data["systems"].items(): - self.systems[system_name][field] = self.get_element_value(system, key) - - def get_assemblies(self): - assemblies = self.file.by_type("IfcRelAggregates") - for assembly in assemblies: - assembly_name = self.get_object_name(assembly) - if not self.is_object_a_component_asset(assembly.RelatingObject): - continue - self.assemblies[assembly_name] = { - "CreatedBy": self.get_email_from_history(assembly.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(assembly.OwnerHistory), - "SheetName": "Assembly", - "ParentName": self.get_object_name(assembly.RelatingObject), - "ChildNames": ",".join([o.Name if o.Name else "" for o in assembly.RelatedObjects]), - "AssemblyType": "n/a", # I don't understand this field - "ExtSystem": self.get_ext_system_from_history(assembly.OwnerHistory), - "ExtObject": self.get_ext_object(assembly), - "ExtIdentifier": assembly.GlobalId, - "Description": self.get_object_attribute(assembly, "Description", default="n/a"), - } - for field, key in self.custom_data["assemblies"].items(): - self.assemblies[assembly_name][field] = self.get_element_value(assembly, key) - - def get_connections(self): - connections = self.file.by_type("IfcRelConnects") - for connection in connections: - connection_name = self.get_object_name(connection) - self.connections[connection_name] = { - "CreatedBy": self.get_email_from_history(connection.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(connection.OwnerHistory), - # There is ambiguity for what the ConnectionType mapping should be - "ConnectionType": self.get_object_attribute(connection, "Description", default="n/a"), - "SheetName": "Connections", - "RowName1": self.get_row_name_from_connection(connection, "RelatingElement"), - "RowName2": self.get_row_name_from_connection(connection, "RelatedElement"), - "RealizingElement": self.get_port_name_from_connection(connection, "RealizingElement"), - "PortName1": self.get_port_name_from_connection(connection, "RelatingPort"), - "PortName2": self.get_port_name_from_connection(connection, "RelatedPort"), - "ExtSystem": self.get_ext_system_from_history(connection.OwnerHistory), - "ExtObject": self.get_ext_object(connection), - "ExtIdentifier": connection.GlobalId, - "Description": self.get_object_attribute(connection, "Description", default="n/a"), - } - for field, key in self.custom_data["connections"].items(): - self.connections[connection_name][field] = self.get_element_value(connection, key) - - def get_spares(self): - spares = self.file.by_type("IfcConstructionProductResource") - for spare in spares: - spare_name = self.get_object_name(spare) - self.spares[spare_name] = { - "CreatedBy": self.get_email_from_history(spare.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(spare.OwnerHistory), - "Category": self.get_category_from_object(spare, "SpareType"), - "TypeName": self.get_type_name_from_object(spare), - "Suppliers": self.get_contact_pset_value_from_object(spare, "COBie_Spare", "Suppliers"), - "ExtSystem": self.get_ext_system_from_history(spare.OwnerHistory), - "ExtObject": self.get_ext_object(spare), - "ExtIdentifier": spare.GlobalId, - "Description": self.get_object_attribute(spare, "Description", default="n/a"), - "SetNumber": self.get_contact_pset_value_from_object(spare, "COBie_Spare", "SetNumber"), - "PartNumber": self.get_contact_pset_value_from_object(spare, "COBie_Spare", "PartNumber"), - } - for field, key in self.custom_data["spares"].items(): - self.spares[spare_name][field] = self.get_element_value(spare, key) - - def get_resources(self): - resources = self.file.by_type("IfcConstructionProductResource") - for resource in resources: - resource_name = self.get_object_name(resource) - self.resources[resource_name] = { - "CreatedBy": self.get_email_from_history(resource.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(resource.OwnerHistory), - "Category": self.get_object_attribute(resource, "ObjectType", picklist="ResourceType", default="n/a"), - "ExtSystem": self.get_ext_system_from_history(resource.OwnerHistory), - "ExtObject": self.get_ext_object(resource), - "ExtIdentifier": resource.GlobalId, - "Description": self.get_object_attribute(resource, "Description", default="n/a"), - } - for field, key in self.custom_data["resources"].items(): - self.resources[resource_name][field] = self.get_element_value(resource, key) - - def get_jobs(self): - jobs = self.file.by_type("IfcTask") - for job in jobs: - job_name = self.get_object_name(job) - task_time = job.TaskTime - self.jobs[job_name] = { - "CreatedBy": self.get_email_from_history(job.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(job.OwnerHistory), - "Category": self.get_object_attribute(job, "ObjectType", picklist="JobType", default="n/a"), - "Status": self.get_object_attribute(job, "Status", picklist="JobStatusType", default="n/a"), - "TypeName": self.get_type_name_from_object(job), - "Description": self.get_object_attribute(job, "Description", default="n/a"), - "Duration": self.get_object_attribute(task_time, "ScheduleDuration", default=0), - "DurationUnit": "day", - "Start": self.get_object_attribute(task_time, "ScheduleStart", default=0), - "TaskStartUnit": "day", - "Frequency": self.get_object_attribute(task_time.Recurrence, "Occurrences", default=0) - if hasattr(task_time, "Recurrence") - else 0, - "FrequencyUnit": "day", - "ExtSystem": self.get_ext_system_from_history(job.OwnerHistory), - "ExtObject": self.get_ext_object(job), - "ExtIdentifier": job.GlobalId, - "TaskNumber": self.get_object_attribute(job, "Identification"), - "Priors": self.get_priors_from_job(job), - "ResourceNames": self.get_resource_names_from_job(job), - } - for field, key in self.custom_data["jobs"].items(): - self.jobs[job_name][field] = self.get_element_value(job, key) - - # Impacts is not explicitly defined as a mapping in the responsibliity - # matrix. This is my best guess. This data should not be relied upon until - # this is clarified. - def get_impacts(self): - impacts = self.file.by_type("IfcPropertySet") - for impact in impacts: - if impact.Name != "Pset_EnvironmentalImpactValues" or not impact.HasProperties: - continue - for property in impact.HasProperties: - property_name = "{}-{}".format(property.id(), self.get_object_name(property)) - self.impacts[property_name] = { - "CreatedBy": self.get_email_from_history(impact.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(impact.OwnerHistory), - "ImpactType": None, - "ImpactStage": None, - "SheetName": "Impacts", - "RowName": "n/a", - "Value": self.get_property_value(property), - "Unit": "{}{}".format(property.Unit.Prefix, property.Unit.Name) - if hasattr(property, "Unit") and property.Unit - else "n/a", - "LeadInTime": self.get_property_value(property, name="LeadInTime"), - "Duration": self.get_property_value(property, name="Duration"), - "LeadOutTime": self.get_property_value(property, name="LeadOutTime"), - "ExtSystem": self.get_ext_system_from_history(impact.OwnerHistory), - "ExtObject": self.get_ext_object(impact), - "ExtIdentifier": impact.GlobalId, - "Description": self.get_object_attribute(impact, "Description", default="n/a"), - } - for field, key in self.custom_data["impacts"].items(): - self.impacts[impact_name][field] = self.get_element_value(impact, key) - - def get_documents(self): - documents = self.file.by_type("IfcDocumentInformation") - for document in documents: - document_name = self.get_object_name(document) - self.documents[document_name] = { - "CreatedBy": self.get_email_from_history(document.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(document.OwnerHistory), - "Category": "n/a", # I am not sure what this mapping is meant to be - "ApprovalBy": self.get_object_attribute( - document, "IntendedUse", picklist="ApprovalBy", default="Information Only" - ), - "Stage": self.get_object_attribute(document, "Scope", picklist="StageType", default="Required"), - "SheetName": "Documents", - "RowName": "n/a", - "Directory": self.get_directory_from_document(document), - "File": self.get_file_from_document(document), - "ExtSystem": self.get_ext_system_from_history(document.OwnerHistory), - "ExtObject": self.get_ext_object(document), - "ExtIdentifier": document.GlobalId, - "Description": self.get_object_attribute(document, "Description", default=document_name), - "Reference": document_name, - } - for field, key in self.custom_data["documents"].items(): - self.documents[document_name][field] = self.get_element_value(document, key) - - # Attributes is not explicitly defined as a mapping in the responsibliity - # matrix. This is my best guess. This data should not be relied upon until - # this is clarified. - def get_attributes(self): - attributes = self.file.by_type("IfcPropertySet") - for attribute in attributes: - if not attribute.HasProperties: - continue - for property in attribute.HasProperties: - property_name = "{}-{}".format(property.id(), self.get_object_name(property)) - self.attributes[property_name] = { - "CreatedBy": self.get_email_from_history(attribute.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(attribute.OwnerHistory), - "Category": "n/a", # I am not sure what this mapping is meant to be - "SheetName": "Attributes", - "RowName": "n/a", # I am not sure what this mapping is meant to be - "Value": self.get_property_value(property), - "Unit": "{}{}".format( - property.Unit.Prefix if hasattr(property.Unit, "Prefix") else "", - property.Unit.Name if hasattr(property.Unit, "Name") else "n/a", - ) - if hasattr(property, "Unit") and property.Unit - else "n/a", - "ExtSystem": self.get_ext_system_from_history(attribute.OwnerHistory), - "ExtObject": self.get_ext_object(attribute), - "ExtIdentifier": attribute.GlobalId, - "Description": self.get_object_attribute(attribute, "Description", default="n/a"), - # I'm holding off implementing this until I understand a bit - # more about attributes - "AllowedValues": "n/a", - } - - def get_coordinates(self): - coordinates = ( - self.file.by_type("IfcBuildingStorey") + self.file.by_type("IfcSpace") + self.file.by_type("IfcProduct") - ) - for coordinate in coordinates: - coordinate_name = "{}/{}".format(coordinate.is_a(), self.get_object_name(coordinate)) - mat = ifcopenshell.util.placement.get_local_placement(coordinate.ObjectPlacement) - x, y, z = mat[:,3][:3] - self.coordinates[coordinate_name] = { - "CreatedBy": self.get_email_from_history(coordinate.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(coordinate.OwnerHistory), - "Category": "Location", # I am not sure what this mapping is meant to be - "SheetName": "Coordinates", - "RowName": "n/a", - "CoordinateXAxis": x, - "CoordinateYAxis": y, - "CoordinateZAxis": z, - "ExtSystem": self.get_ext_system_from_history(coordinate.OwnerHistory), - "ExtObject": self.get_ext_object(coordinate), - "ExtIdentifier": coordinate.GlobalId, - # Holding off implementing this, see Bug #688: - # https://github.com/IfcOpenShell/IfcOpenShell/issues/688 - "ClockwiseRotation": "n/a", # X axis - "ElevationalRotation": "n/a", # Y axis - "YawRotation": "n/a", # Z axis - } - - # I don't fully understand this worksheet. Don't trust this data. - def get_issues(self): - issues = self.file.by_type("IfcApproval") - for issue in issues: - issue_name = self.get_object_name(issue) - self.issues[issue_name] = { - "CreatedBy": self.get_email_from_history(issue.OwnerHistory), - "CreatedOn": self.get_created_on_from_history(issue.OwnerHistory), - "Type": "n/a", # How do we get to the Pset_Risk from the IfcApproval? - "Risk": "n/a", # How do we get to the Pset_Risk from the IfcApproval? - "Chance": "n/a", # How do we get to the Pset_Risk from the IfcApproval? - "Impact": "n/a", # How do we get to the Pset_Risk from the IfcApproval? - "SheetName1": "n/a", - "RowName1": "n/a", - "SheetName2": "n/a", - "RowName2": "n/a", - "Description": self.get_object_attribute(issue, "Description", default="n/a"), - "Owner": self.get_email_from_history(issue.RequestingApproval), # Is this correct? - "Mitigation": "n/a", - "ExtSystem": self.get_ext_system_from_history(issue.OwnerHistory), - "ExtObject": self.get_ext_object(issue), - "ExtIdentifier": issue.GlobalId, - } - - def get_directory_from_document(self, document): - if self.file.schema == "IFC2X3": - if document.HasDocumentReferences: - for reference in document.HasDocumentReferences: - return self.get_object_attribute(reference, "Location", default="n/a") - else: - return self.get_object_attribute(document, "Location", default="n/a") - - def get_file_from_document(self, document): - if self.file.schema == "IFC2X3": - if document.HasDocumentReferences: - for reference in document.HasDocumentReferences: - return self.get_object_attribute(reference, "Name", default="n/a") - else: - self.get_object_attribute(document, "Identification", default="n/a") - - def get_resource_names_from_job(self, job): - names = [] - if job.OperatesOn and job.OperatesOn.RelatedObjects: - for object in job.OperatesOn.RelatedObjects: - names.append(object.Name) - return ",".join(names) - - def get_priors_from_job(self, job): - # The responsibility matrix is vague as to whether it expects a task - # name or a task identification. I chose task name. - if ( - job.IsSuccessorFrom - and job.IsSuccessorFrom.RelatingProcess - and job.IsSuccessorFrom.RelatingProcess.is_a("IfcTask") - ): - return self.get_object_name(job.IsSuccessorFrom.RelatingProcess) - - def get_row_name_from_connection(self, connection, key): - if not connection.is_a("IfcRelConnectsElements"): - return None - object = getattr(connection, key) - if self.is_object_a_component_asset(object): - return object.Name - self.logger.error("The connected object relationship %s is not a component asset for %s", key, connection) - - def get_port_name_from_connection(self, connection, key): - if not connection.is_a("IfcRelConnectsPorts"): - return None - object = getattr(connection, key) - if object and self.is_object_a_component_asset(object): - return object.Name - self.logger.error("The connected object relationship %s is not a component asset for %s", key, connection) - - def is_object_a_component_asset(self, obj): - return obj in self.component_assets - - def get_space_name_from_component(self, component): - for relationship in component.ContainedInStructure: - if relationship.RelatingStructure.is_a("IfcSpace") and relationship.RelatingStructure.Name: - return relationship.RelatingStructure.Name - self.logger.error("A related space name could not be determined for %s", component) - - def get_type_name_from_object(self, object): - if self.file.schema == "IFC2X3": - for relationship in object.IsDefinedBy: - if relationship.is_a("IfcRelDefinesByType") and relationship.RelatingType.Name: - return relationship.RelatingType.Name - else: - for relationship in object.IsTypedBy: - if relationship.RelatingType.Name: - return relationship.RelatingType.Name - self.logger.error("A related type name could not be determined for %s", object) - - def get_expected_life_from_type(self, type): - if self.file.schema == "IFC2X3": - return self.get_pset_value_from_object(type, "COBie_ServiceLife", "ServiceLifeDuration", "n/a") - return self.get_pset_value_from_object(type, "Pset_ServiceLife", "ServiceLifeDuration", "n/a") - - def get_contact_pset_value_from_object(self, object, pset_name, property_name): - result = self.get_pset_value_from_object(object, pset_name, property_name) - if not result: - self.logger.error("No property %s in %s was found for %s", property_name, pset_name, object) - if result not in self.contacts: - self.logger.error("A coresponding %s contact in %s was not found for %s", property_name, pset_name, object) - return result - - def get_pset_value_from_object(self, object, pset_name, property_name, default=None, picklist=None): - pset = self.get_pset_from_object(object, pset_name) - if not pset: - if picklist: - self.picklists[picklist].append(default) - return default - prop = self.get_property_from_pset(pset, property_name, default) - if picklist: - self.picklists[picklist].append(prop) - return prop - - def get_grouped_product_names_from_object(self, object, type): - names = [] - for relationship in object.IsGroupedBy: - for related_object in relationship.RelatedObjects: - if related_object.is_a(type): - names.append(related_object.Name) - if names: - return ",".join(names) - self.logger.error("No related %s were found for %s", type, object) - - def get_net_area_from_space(self, space): - qto = self.get_qto_from_object(space, "Qto_SpaceBaseQuantities") - if not qto: - return "n/a" - return self.get_property_from_qto(qto, "NetFloorArea", "AreaValue") - - def get_gross_area_from_space(self, space): - qto = self.get_qto_from_object(space, "Qto_SpaceBaseQuantities") - if not qto: - return "n/a" - return self.get_property_from_qto(qto, "GrossFloorArea", "AreaValue") - - def get_usable_height_from_space(self, space): - qto = self.get_qto_from_object(space, "Qto_SpaceBaseQuantities") - if not qto: - return "n/a" - return self.get_property_from_qto(qto, "FinishCeilingHeight", "LengthValue") - - def get_qto_from_object(self, object, name): - for relationship in object.IsDefinedBy: - if ( - relationship.is_a("IfcRelDefinesByProperties") - and relationship.RelatingPropertyDefinition.is_a("IfcQuantitySet") - and relationship.RelatingPropertyDefinition.Name == name - ): - return relationship.RelatingPropertyDefinition - self.logger.warning("The qto %s was not found for %s", name, object) - - def get_property_from_qto(self, qto, name, attribute): - for property in qto.Quantities: - if property.Name == name: - return getattr(property, attribute) - self.logger.warning("The quantity value %s was not found for %s", name, qto) - return "n/a" - - def get_property_from_pset(self, pset, name, default=None): - for prop in pset.HasProperties: - if prop.Name == name: - return prop.NominalValue.wrappedValue - self.logger.warning("The property %s was not found for %s", name, pset) - return default - - def get_property_value(self, prop, name=None): - if not prop.is_a("IfcPropertySingleValue"): - return "n/a" - if name is not None and prop.Name != name: - return "n/a" - value = self.get_object_attribute(prop, "NominalValue", default=None) - if value: - return value.wrappedValue - return "n/a" - - def get_pset_from_object(self, object, name): - if object.is_a("IfcTypeObject"): - if object.HasPropertySets: - for pset in object.HasPropertySets: - if pset.is_a("IfcPropertySet") and pset.Name == name: - return pset - else: - for relationship in object.IsDefinedBy: - if ( - relationship.is_a("IfcRelDefinesByProperties") - and relationship.RelatingPropertyDefinition.is_a("IfcPropertySet") - and relationship.RelatingPropertyDefinition.Name == name - ): - return relationship.RelatingPropertyDefinition - self.logger.warning("The pset %s was not found for %s", name, object) - - def get_height_from_storey(self, storey): - for relationship in storey.IsDefinedBy: - if not relationship.RelatingPropertyDefinition.is_a("IfcElementQuantity"): - continue - for quantity in relationship.RelatingPropertyDefinition.Quantities: - if quantity.is_a("IfcQuantityLength") and quantity.LengthValue: - return quantity.LengthValue - self.logger.warning("A height length value was not found for %s", storey) - return "n/a" - - def get_created_on_from_history(self, history): - if history.CreationDate: - return datetime.datetime.fromtimestamp(history.CreationDate).isoformat() - self.logger.warning("A created on date was not found for %s", history) - return self.default_date - - def get_object_attribute(self, object, attribute, is_primary_key=False, picklist=None, default=None): - result = getattr(object, attribute) - if result: - if picklist: - self.picklists[picklist].append(result) - return result - if is_primary_key: - self.logger.error("The primary key attribute %s was not found for %s", attribute, object) - else: - self.logger.warning("The attribute %s was not found for %s", attribute, object) - return default - - def get_ext_project_object(self): - self.picklists["objType"].append("IfcProject") - return "IfcProject" - - def get_ext_site_object(self): - self.picklists["objType"].append("IfcSite") - return "IfcSite" - - def get_ext_object(self, object): - self.picklists["objType"].append(object.is_a()) - return object.is_a() - - def get_ext_system_from_history(self, history): - return history.OwningApplication.ApplicationFullName - - def get_object_name(self, object): - if not object.Name: - self.logger.error("A primary key name was not found for %s", object) - return "Object{}".format(object.id()) - return object.Name - - def get_area_measurement_from_building(self, building): - for relationship in building.IsDefinedBy: - if ( - relationship.RelatingPropertyDefinition.is_a("IfcElementQuantity") - and relationship.RelatingPropertyDefinition.MethodOfMeasurement - ): - return relationship.RelatingPropertyDefinition.MethodOfMeasurement - self.logger.warning("A method of measurement was not defined for %s", building) - - def get_unit_type_from_units(self, units, type): - for unit in units: - if unit.UnitType == type: - if unit.is_a("IfcSIUnit") and unit.Prefix: - return "{}{}".format(unit.Prefix, unit.Name) - return unit.Name - self.logger.error("A unit %s was not defined in this project for %s", type, units) - - def get_monetary_unit_from_units(self, units): - for unit in units: - if unit.is_a("IfcMonetaryUnit"): - return unit.Currency - self.logger.error("A monetary unit could not be found for %s", units) - - def get_project_globalid_from_building(self, building): - return self.get_parent_spatial_element(building, "IfcProject").GlobalId - - def get_site_globalid_from_building(self, building): - return self.get_parent_spatial_element(building, "IfcSite").GlobalId - - def get_project_name_from_building(self, building): - project = self.get_parent_spatial_element(building, "IfcProject") - if project.Name: - return project.Name - self.logger.error("The project name is empty for %s", project) - return "n/a" - - def get_site_name_from_building(self, building): - site = self.get_parent_spatial_element(building, "IfcSite") - if site.Name: - return site.Name - self.logger.error("The site name is empty for %s", site) - return "n/a" - - def get_units_from_building(self, building): - return self.get_parent_spatial_element(building, "IfcProject").UnitsInContext.Units - - def get_parent_spatial_element(self, child, name): - for relationship in child.Decomposes: - if relationship.RelatingObject.is_a(name): - return relationship.RelatingObject - return self.get_parent_spatial_element(relationship.RelatingObject, name) - return None - - def get_category_from_object(self, object, picklist): - class_identification = None - class_name = None - for association in object.HasAssociations: - if not association.is_a("IfcRelAssociatesClassification"): - continue - if not association.RelatingClassification.is_a("IfcClassificationReference"): - continue - if self.file.schema == "IFC2X3": - class_identification = association.RelatingClassification.ItemReference - else: - class_identification = association.RelatingClassification.Identification - class_name = association.RelatingClassification.Name - break - if not class_identification or class_name: - self.logger.error("The classification has invalid identification and name for %s", object) - result = "{}:{}".format(class_identification, class_name) - self.picklists[picklist].append(result) - return result - # The responsibility matrix lists a fallback, but it is a very - # cumbersome check, and so it is not implemented here. - - def get_name_from_person(self, person, attribute): - name = getattr(person, attribute) - if not name or not name.isalpha(): - self.logger.warning('The person\'s %s seems to be badly formatted ("%s") for %s', attribute, name, person) - return name if name else "n/a" - - def get_lines_from_address(self, address): - result = self.get_attribute_from_address(address, "AddressLines") - if isinstance(result, tuple): - return ", ".join(result) - return result - - def get_attribute_from_address(self, address, attribute): - result = getattr(address, attribute) - if not result: - self.logger.warning("The address %s seems to not exist for %s", attribute, address) - return "n/a" - return result - - def get_email_from_history(self, history): - person = history.OwningUser.ThePerson - organisation = history.OwningUser.TheOrganization - email = self.get_email_from_person_or_organisation(person) - if email: - return email - - email = self.get_email_from_person_or_organisation(organisation) - if email: - return email - - given_name = person.GivenName if person.GivenName else "unknown" - family_name = person.FamilyName if person.FamilyName else "unknown" - organisation_name = organisation.Name if organisation.Name else "unknown" - - if given_name == "unknown" and family_name == "unknown" and organisation_name == "unknown": - self.logger.error("No primary key could be determined from %s", history) - - return "{}{}@{}".format(given_name, family_name, organisation_name) - - def get_postal_address_from_history(self, history): - for address in history.OwningUser.ThePerson.Addresses or []: - if address.is_a("IfcPostalAddress"): - return address - for address in history.OwningUser.TheOrganization.Addresses or []: - if address.is_a("IfcPostalAddress"): - return address - return self.file.createIfcPostalAddress() - - def get_category_from_history(self, history): - roles = [] - both = history.OwningUser - person = both.ThePerson - organisation = both.TheOrganization - both_roles = list(both.Roles) if both.Roles else [] - person_roles = list(person.Roles) if person.Roles else [] - organisation_roles = list(organisation.Roles) if organisation.Roles else [] - for role in both_roles + person_roles + organisation_roles: - roles.append(self.get_role(role)) - result = ",".join(set(roles)) - if not result: - self.logger.error("No roles could be found for %s", history) - return - self.picklists["Category-Role"].append(result) - return result - - def get_phone_from_history(self, history): - person = history.OwningUser.ThePerson - organisation = history.OwningUser.TheOrganization - phone = self.get_phone_from_person_or_organisation(person) - if phone: - return phone - phone = self.get_phone_from_person_or_organisation(organisation) - if phone: - return phone - return "n/a" - - def get_ext_object_from_history(self, history): - result = history.OwningUser.is_a() - self.picklists["objType"].append(result) - return result - - def get_department_from_history(self, history): - organisation = history.OwningUser.TheOrganization - department = self.get_internal_location_from_organisation(organisation) - if department: - return department - last_department = None - for relationship in organisation.Relates: - for related_organisation in relationship.RelatedOrganizations: - department = self.get_internal_location_from_organisation(related_organisation) - if department: - last_department = department - if last_department: - return last_department - return history.OwningUser.TheOrganization.Name or "n/a" - - def get_internal_location_from_organisation(self, organisation): - for address in organisation.Addresses or []: - if address.is_a("IfcPostalAddress"): - return address.InternalLocation - self.logger.warning("An internal location was not found for %s", organisation) - - def get_role(self, role): - if role.Role == "USERDEFINED": - return role.UserDefinedRole - return role.Role - - def get_phone_from_person_or_organisation(self, person_or_org): - for address in person_or_org.Addresses or []: - if address.is_a("IfcTelecomAddress"): - return address.TelephoneNumbers[0] - self.logger.warning("A phone was not found for {}", person_or_org) - - def get_email_from_person_or_organisation(self, person_or_org): - for address in person_or_org.Addresses or []: - if address.is_a("IfcTelecomAddress"): - return address.ElectronicMailAddresses[0] - self.logger.warning("An email address was not found for {}", person_or_org) - - def get_element_value(self, element, key): - value = self.selector.get_element_value(element, key) - if hasattr(value, "wrappedValue"): - return value.wrappedValue - return value - - -class CobieWriter: - def __init__(self, parser, filename=None): - self.filename = filename - self.parser = parser - self.sheets = [] - self.sheet_data = {} - self.colours = { - "r": "fdff8e", # Required - "i": "fdcd94", # Internal reference - "e": "cd95ff", # External reference - "o": "cdffc8", # Optional - "s": "c0c0c0", # Secondary information - "p": "9ccaff", # Project specific - "n": "000000", # Not used - } - - def write(self): - self.sheets = [ - "Contact", - "Facility", - "Floor", - "Space", - "Zone", - "Type", - "Component", - "System", - "Assembly", - "Connection", - "Spare", - "Resource", - "Job", - "Impact", - "Document", - "Attribute", - "Coordinate", - "Issue", - ] - self.write_data( - "Contact", - self.parser.contacts, - "Email", - [ - "Email", - "CreatedBy", - "CreatedOn", - "Category", - "Company", - "Phone", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Department", - "OrganizationCode", - "GivenName", - "FamilyName", - "Street", - "PostalBox", - "Town", - "StateRegion", - "PostalCode", - "Country", - ], - "ririrreeeoooooooooo", - self.parser.custom_data["contacts"], - ) - self.write_data( - "Facility", - self.parser.facilities, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "ProjectName", - "SiteName", - "LinearUnits", - "AreaUnits", - "VolumeUnits", - "CostUnit", - "AreaMeasurement", - "ExternalSystem", - "ExternalProjectObject", - "ExternalProjectIdentifier", - "ExternalSiteObject", - "ExternalSiteIdentifier", - "ExternalFacilityObject", - "ExternalFacilityIdentifier", - "Description", - "ProjectDescription", - "SiteDescription", - "Phase", - ], - "ririrriiiireeeeeeeoooo", - self.parser.custom_data["facilities"], - ) - self.write_data( - "Floor", - self.parser.floors, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - "Elevation", - "Height", - ], - "ririeeeooo", - self.parser.custom_data["floors"], - ) - self.write_data( - "Space", - self.parser.spaces, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "FloorName", - "Description", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "RoomTag", - "UsableHeight", - "GrossArea", - "NetArea", - ], - "ririireeeoooo", - self.parser.custom_data["spaces"], - ) - self.write_data( - "Zone", - self.parser.zones, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "SpaceNames", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "ririieeeo", - self.parser.custom_data["zones"], - ) - self.write_data( - "Type", - self.parser.types, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "Description", - "AssetType", - "Manufacturer", - "ModelNumber", - "WarrantyGuarantorParts", - "WarrantyDurationParts", - "WarrantyGuarantorLabor", - "WarrantyDurationLabor", - "WarrantyDurationUnit", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "ReplacementCost", - "ExpectedLife", - "DurationUnit", - "NominalLength", - "NominalWidth", - "NominalHeight", - "ModelReference", - "Shape", - "Size", - "Color", - "Finish", - "Grade", - "Material", - "Constituents", - "Features", - "AccessibilityPerformance", - "CodePerformance", - "SustainabilityPerformance", - ], - "riririoooooooeeeooooooooooooooooooo", - self.parser.custom_data["types"], - ) - self.write_data( - "Component", - self.parser.components, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "TypeName", - "Space", - "Description", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "SerialNumber", - "InstallationDate", - "WarrantyStartDate", - "TagNumber", - "BarCode", - "AssetIdentifier", - ], - "ririireeeoooooo", - self.parser.custom_data["components"], - ) - self.write_data( - "System", - self.parser.systems, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "ComponentNames", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "ririieeeo", - self.parser.custom_data["systems"], - ) - self.write_data( - "Assembly", - self.parser.assemblies, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "SheetName", - "ParentName", - "ChildNames", - "AssemblyType", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "rirrrrreeeo", - self.parser.custom_data["assemblies"], - ) - self.write_data( - "Connection", - self.parser.connections, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "ConnectionType", - "SheetName", - "RowName1", - "RowName2", - "RealizingElement", - "PortName1", - "PortName2", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "ririiiiiiieeeo", - self.parser.custom_data["connections"], - ) - self.write_data( - "Spare", - self.parser.spares, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "TypeName", - "Suppliers", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - "SetNumber", - "PartNumber", - ], - "ririiieeeooo", - self.parser.custom_data["spares"], - ) - self.write_data( - "Resource", - self.parser.resources, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "ririeeeo", - self.parser.custom_data["resources"], - ) - self.write_data( - "Job", - self.parser.jobs, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "Status", - "TypeName", - "Description", - "Duration", - "DurationUnit", - "Start", - "TaskStartUnit", - "Frequency", - "FrequencyUnit", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "TaskNumber", - "Priors", - "ResourceNames", - ], - "ririiirriririeeeoii", - self.parser.custom_data["jobs"], - ) - self.write_data( - "Impact", - self.parser.impacts, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "ImpactType", - "ImpactStage", - "SheetName", - "RowName", - "Value", - "Unit", - "LeadInTime", - "Duration", - "LeadOutTime", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - ], - "ririiiirioooeeeo", - self.parser.custom_data["impacts"], - ) - self.write_data( - "Document", - self.parser.documents, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "ApprovalBy", - "Stage", - "SheetName", - "RowName", - "Directory", - "File", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - "Reference", - ], - "ririiiiirreeeoo", - self.parser.custom_data["documents"], - ) - self.write_data( - "Attribute", - self.parser.attributes, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "SheetName", - "RowName", - "Value", - "Unit", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "Description", - "AllowedValues", - ], - "ririiirreeeoo", - ) - self.write_data( - "Coordinate", - self.parser.coordinates, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Category", - "SheetName", - "RowName", - "CoordinateXAxis", - "CoordinateYAxis", - "CoordinateZAxis", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - "ClockwiseRotation", - "ElevationalRotation", - "YawRotation", - ], - "ririiooooeeeooo", - ) - self.write_data( - "Issue", - self.parser.issues, - "Name", - [ - "Name", - "CreatedBy", - "CreatedOn", - "Type", - "Risk", - "Chance", - "Impact", - "SheetName1", - "RowName1", - "SheetName2", - "RowName2", - "Description", - "Owner", - "Mitigation", - "ExtSystem", - "ExtObject", - "ExtIdentifier", - ], - "ririooooooooooeee", - ) - - def write_data(self, sheet, data, primary_key, fieldnames, colours, custom_data={}): - self.sheet_data[sheet] = {"headers": fieldnames + list(custom_data.keys()), "colours": colours, "rows": []} - for name, row in data.items(): - row[primary_key] = name - values = [] - for fieldname in fieldnames: - values.append(row[fieldname]) - for fieldname in custom_data.keys(): - values.append(row[fieldname]) - self.sheet_data[sheet]["rows"].append(values) - - -class CobieCsvWriter(CobieWriter): - def write(self): - import csv - - super().write() - for sheet, data in self.sheet_data.items(): - with open(os.path.join(self.filename, "{}.csv".format(sheet)), "w", newline="", encoding="utf-8") as file: - writer = csv.writer(file) - writer.writerow(data["headers"]) - for row in data["rows"]: - writer.writerow(row) - - -class CobieXlsWriter(CobieWriter): - def write(self): - from xlsxwriter import Workbook - - super().write() - self.workbook = Workbook(self.filename + ".xlsx") - - self.cell_formats = {} - for key, value in self.colours.items(): - self.cell_formats[key] = self.workbook.add_format() - self.cell_formats[key].set_bg_color(value) - - for sheet in self.sheets: - self.write_worksheet(sheet) - self.workbook.close() - - def write_worksheet(self, name): - worksheet = self.workbook.add_worksheet(name) - r = 0 - c = 0 - for header in self.sheet_data[name]["headers"]: - cell = worksheet.write(r, c, header, self.cell_formats["s"]) - c += 1 - c = 0 - r += 1 - for row in self.sheet_data[name]["rows"]: - c = 0 - for col in row: - if c >= len(self.sheet_data[name]["colours"]): - cell_format = "p" - else: - cell_format = self.sheet_data[name]["colours"][c] - cell = worksheet.write(r, c, col, self.cell_formats[cell_format]) - c += 1 - r += 1 - - -class CobieOdsWriter(CobieWriter): - def write(self): - from odf.opendocument import OpenDocumentSpreadsheet - from odf.style import Style, TableCellProperties - - super().write() - self.doc = OpenDocumentSpreadsheet() - - self.cell_formats = {} - for key, value in self.colours.items(): - style = Style(name=key, family="table-cell") - style.addElement(TableCellProperties(backgroundcolor="#" + value)) - self.doc.automaticstyles.addElement(style) - self.cell_formats[key] = style - - for sheet in self.sheets: - self.write_table(sheet) - self.doc.save(self.filename, True) - - def write_table(self, name): - from odf.table import Table, TableRow, TableCell - from odf.text import P - - table = Table(name=name) - tr = TableRow() - for header in self.sheet_data[name]["headers"]: - tc = TableCell(valuetype="string", stylename="s") - tc.addElement(P(text=header)) - tr.addElement(tc) - table.addElement(tr) - for row in self.sheet_data[name]["rows"]: - tr = TableRow() - c = 0 - for col in row: - if c >= len(self.sheet_data[name]["colours"]): - cell_format = "p" - else: - cell_format = self.sheet_data[name]["colours"][c] - tc = TableCell(valuetype="string", stylename=cell_format) - tc.addElement(P(text=col)) - tr.addElement(tc) - c += 1 - table.addElement(tr) - self.doc.spreadsheet.addElement(table) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Converts COBie IFC MVD into its spreadsheet equivalent") - parser.add_argument("input", type=str, help="Specify an IFC file to process") - parser.add_argument("output", type=str, help="The output directory for CSV or filename for other formats") - parser.add_argument("-l", "--log", type=str, help="Specify where errors should be logged", default="process.log") - parser.add_argument( - "-f", "--format", type=str, help="Choose which format to export in (csv/ods/xlsx)", default="csv" - ) - parser.add_argument( - "-c", "--components", type=str, help="A custom selector for components. Defaults to COBie", default=".COBie" - ) - parser.add_argument( - "-t", "--types", type=str, help="A custom selector for types. Defaults to COBieType", default=".COBieType" - ) - parser.add_argument( - "-d", - "--data", - type=str, - help="JSON file containing custom data to be appended to the COBie spreadsheet template", - default="", - ) - args = vars(parser.parse_args()) - - print("Processing IFC file ...") - - start = time.time() - logging.basicConfig(filename=args["log"], filemode="a", level=logging.DEBUG) - logger = logging.getLogger("IFCtoCOBie") - logger.info("Starting conversion") - selector = ifcopenshell.util.selector.Selector() - parser = IfcCobieParser(logger, selector) - if args["data"]: - with open(bpy.context.scene.BIMProperties.cobie_json_file, "r") as f: - custom_data = json.load(f) - else: - custom_data = {} - parser.parse(args["input"], args["types"], args["components"], custom_data) - - print("Generating reports ...") - - if args["format"] == "xlsx": - writer = CobieXlsWriter(parser, args["output"]) - elif args["format"] == "ods": - writer = CobieOdsWriter(parser, args["output"]) - else: - writer = CobieCsvWriter(parser, args["output"]) - writer.write() - - logger.info("Finished conversion in %ss", time.time() - start) - print("# All reports are complete :-)") diff --git a/src/ifccobie/get_maintainable_assets.py b/src/ifccobie/get_maintainable_assets.py deleted file mode 100644 index 591a080088..0000000000 --- a/src/ifccobie/get_maintainable_assets.py +++ /dev/null @@ -1,79 +0,0 @@ - -# IfcCOBie - Extract COBie data from IFC to spreadsheets -# Copyright (C) 2019, 2020, 2021 Dion Moult -# -# This file is part of IfcCOBie. -# -# IfcCOBie is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# IfcCOBie is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with IfcCOBie. If not, see . - -import json -import ifcopenshell -import ifcopenshell.util.selector - -with open("../blenderbim/blenderbim/bim/schema/entity_descriptions.json") as f: - entity_descriptions = json.load(f) -with open("../blenderbim/blenderbim/bim/schema/enum_descriptions.json") as f: - enum_descriptions = json.load(f) - -print('{|class="wikitable"') -print("! IFC Class") -print("! Predefined Type") - - -def print_entity(entity): - print("|-") - print("| " + entity.name()) - print("| ") - if entity.name() in entity_descriptions: - print( - "{} ... [https://standards.buildingsmart.org/IFC/DEV/IFC4_3/RC1/HTML/link/{}.htm read more]".format( - entity_descriptions[entity.name()], entity.name().lower() - ) - ) - else: - print( - "No description provided ... [https://standards.buildingsmart.org/IFC/DEV/IFC4_3/RC1/HTML/link/{}.htm read more]".format( - entity_descriptions[entity.name()], entity.name().lower() - ) - ) - for attribute in entity.attributes(): - if attribute.name() == "PredefinedType": - enum = attribute.type_of_attribute().declared_type() - print("\nThe following predefined types are defined:\n") - for item in enum.enumeration_items(): - # print('|-') - # print('| ' + entity.name()) - # print('| ' + item) - if enum.name() in enum_descriptions and item in enum_descriptions[enum.name()]: - print( - "* '''{}''' - {} ... [https://standards.buildingsmart.org/IFC/DEV/IFC4_3/RC1/HTML/link/{}.htm read more]".format( - item, enum_descriptions[enum.name()][item], enum.name().lower() - ) - ) - else: - print( - "* '''{}''' - No description provided ... [https://standards.buildingsmart.org/IFC/DEV/IFC4_3/RC1/HTML/link/{}.htm read more]".format( - item, enum.name().lower() - ) - ) - - for subtype in entity.subtypes(): - print_entity(subtype) - - -for asset in ifcopenshell.util.selector.cobie_component_assets: - schema = ifcopenshell.ifcopenshell_wrapper.schema_by_name("IFC4") - print_entity(schema.declaration_by_name(asset)) - -print("|}") diff --git a/src/ifccobie/icon.ico b/src/ifccobie/icon.ico deleted file mode 100644 index b9eee9acb9dc5d899b66ab21088981ec5bbc2f7d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104035 zcmeI530xFM_V~vnyUAvgnC$-dmtA874+c;?a=05e@kmxNyGg(+Dqfg)UojDpbC^*< z@B;4>M7(cQM3iedR4%!15Ks{C0^*5^@c!>rPeIQxh#(q_!{_s*x_f%MU%gjV-Bb0d zoOW5CMAdws# zi{I2&?c?`{FKi=u7gM_4^w%Vks?}{IONW>Ze*4XKZ{nrj{_ocVhta3RyL9Wf3g_cx z-VOfmz%NJG=9J}q=QcUhT5|D7X5J^g@@}VI+qQa*%i_V4j+*5D65Z*a(cS*=@n@!6 zqbI)g@vR8`o$LP|=e^T0|%R<{uwLVxLRB8Qv{H1NT%g2v-1!ZZ%pWmdDGgAJ3X&B zwm7c$sK2lL-{;?Zm{!8w-E%5ntNc#!&6TFb58~(9%zUW#@S)#0pOS}ni!5&_3zDj% z3KCC++`A^L>GxK3^??xO>O{wqn^AfWvv>PtlsQ3AQ14H&5)X0pe2qf?Df@N(qyE;n zF2}6RE0f=kd|hu`a8_Puh^#Eff7Wfw{t1e=y(S$#Jak{2&%M6NwxwC4pt{t})!T9o z`1`t*ghuz4I@~O4cl?jL?p1wgcX{>jz5i1tuCr)^TElWH=w;ZeL$0Rnchz&cf2sW5 zT-o*XQ3Z~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