This commit is contained in:
Andrej730
2024-04-25 11:24:42 +05:00
parent cce2fee1fa
commit 721466c429
10 changed files with 66 additions and 34 deletions
@@ -15,10 +15,17 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
from typing import Any, Optional
class Usecase:
def __init__(self, file, information=None, attributes=None):
def __init__(
self,
file: ifcopenshell.file,
information: ifcopenshell.entity_instance,
attributes: Optional[dict[str, Any]] = None,
):
"""Edits the attributes of an IfcDocumentInformation
For more information about the attributes and data types of an
@@ -44,6 +51,6 @@ class Usecase:
self.file = file
self.settings = {"information": information, "attributes": attributes or {}}
def execute(self):
def execute(self) -> None:
for name, value in self.settings["attributes"].items():
setattr(self.settings["information"], name, value)
@@ -15,10 +15,17 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
import ifcopenshell
from typing import Any, Optional
class Usecase:
def __init__(self, file, reference=None, attributes=None):
def __init__(
self,
file: ifcopenshell.file,
reference: ifcopenshell.entity_instance,
attributes: Optional[dict[str, Any]] = None,
):
"""Edits the attributes of an IfcDocumentReference
For more information about the attributes and data types of an
@@ -47,6 +54,6 @@ class Usecase:
self.file = file
self.settings = {"reference": reference, "attributes": attributes or {}}
def execute(self):
def execute(self) -> None:
for name, value in self.settings["attributes"].items():
setattr(self.settings["reference"], name, value)