misspelling 😅

This commit is contained in:
Andrej730
2023-08-15 15:25:12 +05:00
parent b53c0d551c
commit 69daaff3e1
11 changed files with 31 additions and 31 deletions
@@ -538,7 +538,7 @@ class BIMAnnotationProperties(PropertyGroup):
name="Create Representation For Type", name="Create Representation For Type",
default=False, default=False,
description='Whether "Add type" should define a representation for the type \n' description='Whether "Add type" should define a representation for the type \n'
"or allow occurences to have their own", "or allow occurrences to have their own",
) )
is_adding_type: bpy.props.BoolProperty(default=False) is_adding_type: bpy.props.BoolProperty(default=False)
type_name: bpy.props.StringProperty(name="Name", default="TYPEX") type_name: bpy.props.StringProperty(name="Name", default="TYPEX")
@@ -130,11 +130,11 @@ def update_door_modifier_representation(context, obj):
if tool.Ifc.get_schema() != "IFC2X3": if tool.Ifc.get_schema() != "IFC2X3":
element.OperationType = props.door_type element.OperationType = props.door_type
# occurences attributes # occurrences attributes
occurences = tool.Ifc.get_all_element_occurences(element) occurrences = tool.Ifc.get_all_element_occurrences(element)
for occurence in occurences: for occurrence in occurrences:
occurence.OverallWidth = props.overall_width / si_conversion occurrence.OverallWidth = props.overall_width / si_conversion
occurence.OverallHeight = props.overall_height / si_conversion occurrence.OverallHeight = props.overall_height / si_conversion
update_simple_openings(element, props.overall_width / si_conversion, props.overall_height / si_conversion) update_simple_openings(element, props.overall_width / si_conversion, props.overall_height / si_conversion)
@@ -357,7 +357,7 @@ class MEPGenerator:
segments_data = [] segments_data = []
for segment, port in zip(segments, ports, strict=True): for segment, port in zip(segments, ports, strict=True):
segment_type = ifcopenshell.util.element.get_type(segment) segment_type = ifcopenshell.util.element.get_type(segment)
# if segment doesn't have type we cannot check compatibility by available occurences # if segment doesn't have type we cannot check compatibility by available occurrences
if segment_type is None: if segment_type is None:
return return
segments_data.append((segment_type, port.PredefinedType, port.SystemType)) segments_data.append((segment_type, port.PredefinedType, port.SystemType))
@@ -413,7 +413,7 @@ class MEPGenerator:
for fitting_type in fitting_types: for fitting_type in fitting_types:
if fitting_type.PredefinedType != predefined_type: if fitting_type.PredefinedType != predefined_type:
continue continue
fittings = tool.Ifc.get_all_element_occurences(fitting_type) fittings = tool.Ifc.get_all_element_occurrences(fitting_type)
if not fittings: if not fittings:
continue continue
fitting = fittings[0] fitting = fittings[0]
@@ -497,7 +497,7 @@ class MEPGenerator:
obstruction_type = self.create_obstruction_type(segment) obstruction_type = self.create_obstruction_type(segment)
profile_joiner = DumbProfileJoiner() profile_joiner = DumbProfileJoiner()
# create obstruction occurence and setup it's length and port # create obstruction occurrence and setup it's length and port
# NOTE: at this point we loose current blender objects selection # NOTE: at this point we loose current blender objects selection
bpy.ops.bim.add_constr_type_instance(relating_type_id=obstruction_type.id()) bpy.ops.bim.add_constr_type_instance(relating_type_id=obstruction_type.id())
obstruction_obj = bpy.context.active_object obstruction_obj = bpy.context.active_object
@@ -213,7 +213,7 @@ class AddConstrTypeInstance(bpy.types.Operator):
tool.Ifc, tool.Collector, tool.Spatial, structure_obj=parent_obj, element_obj=obj tool.Ifc, tool.Collector, tool.Spatial, structure_obj=parent_obj, element_obj=obj
) )
# set occurences properties for the types defined with modifiers # set occurrences properties for the types defined with modifiers
if instance_class in ["IfcWindow", "IfcDoor"]: if instance_class in ["IfcWindow", "IfcDoor"]:
pset_name = f"BBIM_{instance_class[3:]}" pset_name = f"BBIM_{instance_class[3:]}"
bbim_pset = ifcopenshell.util.element.get_psets(element).get(pset_name, None) bbim_pset = ifcopenshell.util.element.get_psets(element).get(pset_name, None)
@@ -59,10 +59,10 @@ def update_railing_modifier_ifc_data(context):
# type attributes # type attributes
element.PredefinedType = "USERDEFINED" element.PredefinedType = "USERDEFINED"
# occurences attributes # occurrences attributes
occurences = tool.Ifc.get_all_element_occurences(element) occurrences = tool.Ifc.get_all_element_occurrences(element)
for occurence in occurences: for occurrence in occurrences:
occurence.ObjectType = props.railing_type occurrence.ObjectType = props.railing_type
# update pset # update pset
pset_common = tool.Pset.get_element_pset(element, "Pset_RailingCommon") pset_common = tool.Pset.get_element_pset(element, "Pset_RailingCommon")
@@ -402,8 +402,8 @@ def update_roof_modifier_ifc_data(context):
if props.roof_type == "HIP/GABLE ROOF": if props.roof_type == "HIP/GABLE ROOF":
element.PredefinedType = "GABLE_ROOF" if roof_is_gabled() else "HIP_ROOF" element.PredefinedType = "GABLE_ROOF" if roof_is_gabled() else "HIP_ROOF"
# occurences attributes # occurrences attributes
# occurences = tool.Ifc.get_all_element_occurences(element) # occurrences = tool.Ifc.get_all_element_occurrences(element)
tool.Ifc.edit(obj) tool.Ifc.edit(obj)
@@ -34,7 +34,7 @@ from mathutils import Vector
# TODO: move to some utils helpers/tool module # TODO: move to some utils helpers/tool module
def update_simple_openings(element, opening_width, opening_height): def update_simple_openings(element, opening_width, opening_height):
ifc_file = tool.Ifc.get() ifc_file = tool.Ifc.get()
fillings = tool.Ifc.get_all_element_occurences(element) fillings = tool.Ifc.get_all_element_occurrences(element)
voided_objs = set() voided_objs = set()
has_replaced_opening_representation = False has_replaced_opening_representation = False
@@ -158,11 +158,11 @@ def update_window_modifier_representation(context, obj):
if tool.Ifc.get_schema() != "IFC2X3": if tool.Ifc.get_schema() != "IFC2X3":
element.PartitioningType = props.window_type element.PartitioningType = props.window_type
# occurences attributes # occurrences attributes
occurences = tool.Ifc.get_all_element_occurences(element) occurrences = tool.Ifc.get_all_element_occurrences(element)
for occurence in occurences: for occurrence in occurrences:
occurence.OverallWidth = props.overall_width / si_conversion occurrence.OverallWidth = props.overall_width / si_conversion
occurence.OverallHeight = props.overall_height / si_conversion occurrence.OverallHeight = props.overall_height / si_conversion
update_simple_openings(element, props.overall_width / si_conversion, props.overall_height / si_conversion) update_simple_openings(element, props.overall_width / si_conversion, props.overall_height / si_conversion)
+1 -1
View File
@@ -410,7 +410,7 @@ class Ifc:
def run(cls, command, **kwargs): pass def run(cls, command, **kwargs): pass
def set(cls, ifc): pass def set(cls, ifc): pass
def unlink(cls, element=None, obj=None): pass def unlink(cls, element=None, obj=None): pass
def get_all_element_occurences(cls, element): pass def get_all_element_occurrences(cls, element): pass
@interface @interface
+5 -5
View File
@@ -169,17 +169,17 @@ class Ifc(blenderbim.core.tool.Ifc):
IfcStore.unlink_element(element, obj) IfcStore.unlink_element(element, obj)
@classmethod @classmethod
def get_all_element_occurences(cls, element): def get_all_element_occurrences(cls, element):
if element.is_a("IfcElementType"): if element.is_a("IfcElementType"):
element_type = element element_type = element
occurences = ifcopenshell.util.element.get_types(element_type) occurrences = ifcopenshell.util.element.get_types(element_type)
else: else:
element_type = ifcopenshell.util.element.get_type(element) element_type = ifcopenshell.util.element.get_type(element)
if element_type: if element_type:
occurences = ifcopenshell.util.element.get_types(element_type) occurrences = ifcopenshell.util.element.get_types(element_type)
else: else:
occurences = [element] occurrences = [element]
return occurences return occurrences
class Operator: class Operator:
def execute(self, context): def execute(self, context):
@@ -495,7 +495,7 @@ Scenario: Undo test - create a wall with window opening, flip it and undo
And I undo And I undo
Then nothing happens Then nothing happens
Scenario: Create window type based on window modifier, add an occurence of it and edit it Scenario: Create window type based on window modifier, add an occurrence of it and edit it
Given an empty IFC project Given an empty IFC project
And I set "scene.BIMModelProperties.type_class" to "IfcWindowType" And I set "scene.BIMModelProperties.type_class" to "IfcWindowType"
And I set "scene.BIMModelProperties.type_predefined_type" to "WINDOW" And I set "scene.BIMModelProperties.type_predefined_type" to "WINDOW"
@@ -506,7 +506,7 @@ Scenario: Create window type based on window modifier, add an occurence of it an
And I press "bim.finish_editing_window()" And I press "bim.finish_editing_window()"
Then nothing happens Then nothing happens
Scenario: Create door type based on door modifier, add an occurence of it and edit it Scenario: Create door type based on door modifier, add an occurrence of it and edit it
Given an empty IFC project Given an empty IFC project
And I set "scene.BIMModelProperties.type_class" to "IfcDoorType" And I set "scene.BIMModelProperties.type_class" to "IfcDoorType"
And I set "scene.BIMModelProperties.type_predefined_type" to "DOOR" And I set "scene.BIMModelProperties.type_predefined_type" to "DOOR"
@@ -78,7 +78,7 @@ class Usecase:
parametric profile material of an I-beam, then all beam occurrences must parametric profile material of an I-beam, then all beam occurrences must
also be this I-beam shape, though the length may vary. also be this I-beam shape, though the length may vary.
It is highly recommended for every occurence to have a type. There are It is highly recommended for every occurrence to have a type. There are
some exceptions to the rule, such as in heritage architecture or some exceptions to the rule, such as in heritage architecture or
as-built or dilapidation models, where existing conditions are as-built or dilapidation models, where existing conditions are
ambiguous, unknown or are so bespoke as to have no logical type. ambiguous, unknown or are so bespoke as to have no logical type.