mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 06:09:16 +00:00
Fix #3003.
This commit is contained in:
@@ -189,7 +189,7 @@ def add_drawing(ifc, collector, drawing, target_view=None, location_hint=None):
|
|||||||
ifc.run("group.assign_group", group=group, products=[element])
|
ifc.run("group.assign_group", group=group, products=[element])
|
||||||
collector.assign(camera)
|
collector.assign(camera)
|
||||||
pset = ifc.run("pset.add_pset", product=element, name="EPset_Drawing")
|
pset = ifc.run("pset.add_pset", product=element, name="EPset_Drawing")
|
||||||
if drawing.get_unit_system == "METRIC":
|
if drawing.get_unit_system() == "METRIC":
|
||||||
scale = "1/100"
|
scale = "1/100"
|
||||||
human_scale = "1:100"
|
human_scale = "1:100"
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ class Drawing:
|
|||||||
def get_reference_document(cls, reference): pass
|
def get_reference_document(cls, reference): pass
|
||||||
def get_reference_location(cls, reference): pass
|
def get_reference_location(cls, reference): pass
|
||||||
def get_text_literal(cls, obj): pass
|
def get_text_literal(cls, obj): pass
|
||||||
|
def get_unit_system(cls): pass
|
||||||
def import_assigned_product(cls, obj): pass
|
def import_assigned_product(cls, obj): pass
|
||||||
def import_drawings(cls): pass
|
def import_drawings(cls): pass
|
||||||
def import_schedules(cls): pass
|
def import_schedules(cls): pass
|
||||||
|
|||||||
@@ -353,6 +353,10 @@ class Drawing(blenderbim.core.tool.Drawing):
|
|||||||
def get_path_with_ext(cls, path, ext):
|
def get_path_with_ext(cls, path, ext):
|
||||||
return os.path.splitext(path)[0] + f".{ext}"
|
return os.path.splitext(path)[0] + f".{ext}"
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_unit_system(cls):
|
||||||
|
return bpy.context.scene.unit_settings.system
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_drawing_collection(cls, drawing):
|
def get_drawing_collection(cls, drawing):
|
||||||
obj = tool.Ifc.get_object(drawing)
|
obj = tool.Ifc.get_object(drawing)
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ class TestAddDrawing:
|
|||||||
drawing.get_default_drawing_resource_path("Markers").should_be_called().will_return("markers.svg")
|
drawing.get_default_drawing_resource_path("Markers").should_be_called().will_return("markers.svg")
|
||||||
drawing.get_default_drawing_resource_path("Symbols").should_be_called().will_return("symbols.svg")
|
drawing.get_default_drawing_resource_path("Symbols").should_be_called().will_return("symbols.svg")
|
||||||
drawing.get_default_drawing_resource_path("Patterns").should_be_called().will_return("patterns.svg")
|
drawing.get_default_drawing_resource_path("Patterns").should_be_called().will_return("patterns.svg")
|
||||||
|
drawing.get_unit_system().should_be_called().will_return("METRIC")
|
||||||
ifc.run(
|
ifc.run(
|
||||||
"pset.edit_pset",
|
"pset.edit_pset",
|
||||||
pset="pset",
|
pset="pset",
|
||||||
|
|||||||
Reference in New Issue
Block a user