mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 13:46:54 +00:00
#1153 You can now manage assigned products for all annotations
This commit is contained in:
@@ -109,12 +109,12 @@ class TestDisableEditingText(NewFile):
|
||||
assert obj.BIMTextProperties.is_editing == False
|
||||
|
||||
|
||||
class TestDisableEditingTextProduct(NewFile):
|
||||
class TestDisableEditingAssignedProduct(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
obj.BIMTextProperties.is_editing_product = True
|
||||
subject.disable_editing_text_product(obj)
|
||||
assert obj.BIMTextProperties.is_editing_product == False
|
||||
obj.BIMAssignedProductProperties.is_editing_product = True
|
||||
subject.disable_editing_assigned_product(obj)
|
||||
assert obj.BIMAssignedProductProperties.is_editing_product == False
|
||||
|
||||
|
||||
class TestEnableEditing(NewFile):
|
||||
@@ -153,11 +153,11 @@ class TestEnableEditingText(NewFile):
|
||||
assert obj.BIMTextProperties.is_editing == True
|
||||
|
||||
|
||||
class TestEnableEditingTextProduct(NewFile):
|
||||
class TestEnableEditingAssignedProduct(NewFile):
|
||||
def test_run(self):
|
||||
obj = bpy.data.objects.new("Object", None)
|
||||
subject.enable_editing_text_product(obj)
|
||||
assert obj.BIMTextProperties.is_editing_product == True
|
||||
subject.enable_editing_assigned_product(obj)
|
||||
assert obj.BIMAssignedProductProperties.is_editing_product == True
|
||||
|
||||
|
||||
class TestEnsureUniqueDrawingName(NewFile):
|
||||
@@ -423,14 +423,14 @@ class TestGetTextLiteral(NewFile):
|
||||
assert subject.get_text_literal(obj) == item
|
||||
|
||||
|
||||
class TestGetTextProduct(NewFile):
|
||||
class TestGetAssignedProduct(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
wall = ifc.createIfcWall()
|
||||
label = ifc.createIfcAnnotation()
|
||||
ifcopenshell.api.run("drawing.assign_product", ifc, relating_product=wall, related_object=label)
|
||||
assert subject.get_text_product(label) == wall
|
||||
assert subject.get_assigned_product(label) == wall
|
||||
|
||||
|
||||
class TestImportDrawings(NewFile):
|
||||
@@ -514,7 +514,7 @@ class TestImportTextAttributes(NewFile):
|
||||
assert props.attributes.get("BoxAlignment").string_value == "BoxAlignment"
|
||||
|
||||
|
||||
class TestImportTextProduct(NewFile):
|
||||
class TestImportAssignedProduct(NewFile):
|
||||
def test_run(self):
|
||||
ifc = ifcopenshell.file()
|
||||
tool.Ifc.set(ifc)
|
||||
@@ -525,8 +525,8 @@ class TestImportTextProduct(NewFile):
|
||||
label_obj = bpy.data.objects.new("Object", None)
|
||||
tool.Ifc.link(wall, wall_obj)
|
||||
tool.Ifc.link(label, label_obj)
|
||||
subject.import_text_product(label_obj)
|
||||
assert label_obj.BIMTextProperties.relating_product == wall_obj
|
||||
subject.import_assigned_product(label_obj)
|
||||
assert label_obj.BIMAssignedProductProperties.relating_product == wall_obj
|
||||
|
||||
def test_doing_nothing_if_no_product_to_import(self):
|
||||
ifc = ifcopenshell.file()
|
||||
@@ -534,8 +534,8 @@ class TestImportTextProduct(NewFile):
|
||||
label = ifc.createIfcAnnotation()
|
||||
label_obj = bpy.data.objects.new("Object", None)
|
||||
tool.Ifc.link(label, label_obj)
|
||||
subject.import_text_product(label_obj)
|
||||
assert label_obj.BIMTextProperties.relating_product is None
|
||||
subject.import_assigned_product(label_obj)
|
||||
assert label_obj.BIMAssignedProductProperties.relating_product is None
|
||||
|
||||
|
||||
class TestOpenSchedule(NewFile):
|
||||
|
||||
Reference in New Issue
Block a user