mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 13:18:00 +00:00
bim.calculate_quantity - remove convertion part
now the convertion already happens in QtoCalculator.calculate_quantity
This commit is contained in:
@@ -386,27 +386,8 @@ class CalculateQuantity(bpy.types.Operator):
|
|||||||
|
|
||||||
def calculate_quantity(self, obj, context):
|
def calculate_quantity(self, obj, context):
|
||||||
quantity = self.qto_calculator.calculate_quantity(obj.PsetProperties.active_pset_name, self.prop, obj)
|
quantity = self.qto_calculator.calculate_quantity(obj.PsetProperties.active_pset_name, self.prop, obj)
|
||||||
prefix, name = self.get_blender_prefix_name(context)
|
|
||||||
quantity = ifcopenshell.util.unit.convert(quantity, None, "METRE", prefix, name)
|
|
||||||
return round(quantity, 3)
|
return round(quantity, 3)
|
||||||
|
|
||||||
def get_prefix_name(self, value):
|
|
||||||
if "/" in value:
|
|
||||||
return value.split("/")
|
|
||||||
return None, value
|
|
||||||
|
|
||||||
def get_blender_prefix_name(self, context):
|
|
||||||
unit_settings = context.scene.unit_settings
|
|
||||||
if unit_settings.system == "IMPERIAL":
|
|
||||||
if unit_settings.length_unit == "INCHES":
|
|
||||||
return None, "inch"
|
|
||||||
elif unit_settings.length_unit == "FEET":
|
|
||||||
return None, "foot"
|
|
||||||
elif unit_settings.system == "METRIC":
|
|
||||||
if unit_settings.length_unit == "METERS":
|
|
||||||
return None, "METRE"
|
|
||||||
return unit_settings.length_unit[0 : -len("METERS")], "METRE"
|
|
||||||
|
|
||||||
|
|
||||||
class GuessQuantity(bpy.types.Operator):
|
class GuessQuantity(bpy.types.Operator):
|
||||||
bl_idname = "bim.guess_quantity"
|
bl_idname = "bim.guess_quantity"
|
||||||
|
|||||||
Reference in New Issue
Block a user