mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
misspelling 😅
This commit is contained in:
@@ -538,7 +538,7 @@ class BIMAnnotationProperties(PropertyGroup):
|
||||
name="Create Representation For Type",
|
||||
default=False,
|
||||
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)
|
||||
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":
|
||||
element.OperationType = props.door_type
|
||||
|
||||
# occurences attributes
|
||||
occurences = tool.Ifc.get_all_element_occurences(element)
|
||||
for occurence in occurences:
|
||||
occurence.OverallWidth = props.overall_width / si_conversion
|
||||
occurence.OverallHeight = props.overall_height / si_conversion
|
||||
# occurrences attributes
|
||||
occurrences = tool.Ifc.get_all_element_occurrences(element)
|
||||
for occurrence in occurrences:
|
||||
occurrence.OverallWidth = props.overall_width / si_conversion
|
||||
occurrence.OverallHeight = 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 = []
|
||||
for segment, port in zip(segments, ports, strict=True):
|
||||
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:
|
||||
return
|
||||
segments_data.append((segment_type, port.PredefinedType, port.SystemType))
|
||||
@@ -413,7 +413,7 @@ class MEPGenerator:
|
||||
for fitting_type in fitting_types:
|
||||
if fitting_type.PredefinedType != predefined_type:
|
||||
continue
|
||||
fittings = tool.Ifc.get_all_element_occurences(fitting_type)
|
||||
fittings = tool.Ifc.get_all_element_occurrences(fitting_type)
|
||||
if not fittings:
|
||||
continue
|
||||
fitting = fittings[0]
|
||||
@@ -497,7 +497,7 @@ class MEPGenerator:
|
||||
obstruction_type = self.create_obstruction_type(segment)
|
||||
|
||||
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
|
||||
bpy.ops.bim.add_constr_type_instance(relating_type_id=obstruction_type.id())
|
||||
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
|
||||
)
|
||||
|
||||
# set occurences properties for the types defined with modifiers
|
||||
# set occurrences properties for the types defined with modifiers
|
||||
if instance_class in ["IfcWindow", "IfcDoor"]:
|
||||
pset_name = f"BBIM_{instance_class[3:]}"
|
||||
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
|
||||
element.PredefinedType = "USERDEFINED"
|
||||
# occurences attributes
|
||||
occurences = tool.Ifc.get_all_element_occurences(element)
|
||||
for occurence in occurences:
|
||||
occurence.ObjectType = props.railing_type
|
||||
# occurrences attributes
|
||||
occurrences = tool.Ifc.get_all_element_occurrences(element)
|
||||
for occurrence in occurrences:
|
||||
occurrence.ObjectType = props.railing_type
|
||||
|
||||
# update pset
|
||||
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":
|
||||
element.PredefinedType = "GABLE_ROOF" if roof_is_gabled() else "HIP_ROOF"
|
||||
|
||||
# occurences attributes
|
||||
# occurences = tool.Ifc.get_all_element_occurences(element)
|
||||
# occurrences attributes
|
||||
# occurrences = tool.Ifc.get_all_element_occurrences(element)
|
||||
|
||||
tool.Ifc.edit(obj)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ from mathutils import Vector
|
||||
# TODO: move to some utils helpers/tool module
|
||||
def update_simple_openings(element, opening_width, opening_height):
|
||||
ifc_file = tool.Ifc.get()
|
||||
fillings = tool.Ifc.get_all_element_occurences(element)
|
||||
fillings = tool.Ifc.get_all_element_occurrences(element)
|
||||
|
||||
voided_objs = set()
|
||||
has_replaced_opening_representation = False
|
||||
@@ -158,11 +158,11 @@ def update_window_modifier_representation(context, obj):
|
||||
if tool.Ifc.get_schema() != "IFC2X3":
|
||||
element.PartitioningType = props.window_type
|
||||
|
||||
# occurences attributes
|
||||
occurences = tool.Ifc.get_all_element_occurences(element)
|
||||
for occurence in occurences:
|
||||
occurence.OverallWidth = props.overall_width / si_conversion
|
||||
occurence.OverallHeight = props.overall_height / si_conversion
|
||||
# occurrences attributes
|
||||
occurrences = tool.Ifc.get_all_element_occurrences(element)
|
||||
for occurrence in occurrences:
|
||||
occurrence.OverallWidth = props.overall_width / si_conversion
|
||||
occurrence.OverallHeight = props.overall_height / si_conversion
|
||||
|
||||
update_simple_openings(element, props.overall_width / si_conversion, props.overall_height / si_conversion)
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ class Ifc:
|
||||
def run(cls, command, **kwargs): pass
|
||||
def set(cls, ifc): 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
|
||||
|
||||
@@ -169,17 +169,17 @@ class Ifc(blenderbim.core.tool.Ifc):
|
||||
IfcStore.unlink_element(element, obj)
|
||||
|
||||
@classmethod
|
||||
def get_all_element_occurences(cls, element):
|
||||
def get_all_element_occurrences(cls, element):
|
||||
if element.is_a("IfcElementType"):
|
||||
element_type = element
|
||||
occurences = ifcopenshell.util.element.get_types(element_type)
|
||||
occurrences = ifcopenshell.util.element.get_types(element_type)
|
||||
else:
|
||||
element_type = ifcopenshell.util.element.get_type(element)
|
||||
if element_type:
|
||||
occurences = ifcopenshell.util.element.get_types(element_type)
|
||||
occurrences = ifcopenshell.util.element.get_types(element_type)
|
||||
else:
|
||||
occurences = [element]
|
||||
return occurences
|
||||
occurrences = [element]
|
||||
return occurrences
|
||||
|
||||
class Operator:
|
||||
def execute(self, context):
|
||||
|
||||
@@ -495,7 +495,7 @@ Scenario: Undo test - create a wall with window opening, flip it and undo
|
||||
And I undo
|
||||
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
|
||||
And I set "scene.BIMModelProperties.type_class" to "IfcWindowType"
|
||||
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()"
|
||||
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
|
||||
And I set "scene.BIMModelProperties.type_class" to "IfcDoorType"
|
||||
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
|
||||
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
|
||||
as-built or dilapidation models, where existing conditions are
|
||||
ambiguous, unknown or are so bespoke as to have no logical type.
|
||||
|
||||
Reference in New Issue
Block a user