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)
+1 -1
View File
@@ -259,7 +259,7 @@ class file(object):
self.history_size = 64
self.history = []
self.future = []
self.transaction = None
self.transaction: Optional[Transaction] = None
import weakref
@@ -18,8 +18,12 @@
import numpy as np
import collections
import collections.abc
import ifcopenshell
import ifcopenshell.api
import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.unit
from math import cos, sin, pi, tan, radians, degrees, atan, sqrt, ceil
from typing import List, Tuple, Type, Union
from itertools import chain