mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 19:09:58 +00:00
Fixed angle input for imperial units in polyline wall and measure tool.
This commit is contained in:
@@ -327,7 +327,7 @@ class DrawPolylineWall(bpy.types.Operator):
|
|||||||
|
|
||||||
def recalculate_inputs(self, context):
|
def recalculate_inputs(self, context):
|
||||||
if self.number_input:
|
if self.number_input:
|
||||||
is_valid, self.number_output = tool.Snap.validate_input(self.number_output)
|
is_valid, self.number_output = tool.Snap.validate_input(self.number_output, self.input_type)
|
||||||
self.input_panel[self.input_type] = self.number_output
|
self.input_panel[self.input_type] = self.number_output
|
||||||
if not is_valid:
|
if not is_valid:
|
||||||
self.report({"WARNING"}, "The number typed is not valid.")
|
self.report({"WARNING"}, "The number typed is not valid.")
|
||||||
|
|||||||
@@ -2336,7 +2336,7 @@ class MeasureTool(bpy.types.Operator):
|
|||||||
|
|
||||||
def recalculate_inputs(self, context):
|
def recalculate_inputs(self, context):
|
||||||
if self.number_input:
|
if self.number_input:
|
||||||
is_valid, self.number_output = tool.Snap.validate_input(self.number_output)
|
is_valid, self.number_output = tool.Snap.validate_input(self.number_output, self.input_type)
|
||||||
self.input_panel[self.input_type] = self.number_output
|
self.input_panel[self.input_type] = self.number_output
|
||||||
if not is_valid:
|
if not is_valid:
|
||||||
self.report({"WARNING"}, "The number typed is not valid.")
|
self.report({"WARNING"}, "The number typed is not valid.")
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
cls.update_snaping_point(intersection, "Plane")
|
cls.update_snaping_point(intersection, "Plane")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_input(cls, input_number):
|
def validate_input(cls, input_number, input_type):
|
||||||
|
|
||||||
grammar_imperial = """
|
grammar_imperial = """
|
||||||
start: FORMULA? dim expr?
|
start: FORMULA? dim expr?
|
||||||
@@ -565,6 +565,10 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
parser = Lark(grammar_metric)
|
parser = Lark(grammar_metric)
|
||||||
factor = 1
|
factor = 1
|
||||||
|
|
||||||
|
if input_type == 'A':
|
||||||
|
parser = Lark(grammar_metric)
|
||||||
|
factor = 1
|
||||||
|
|
||||||
parse_tree = parser.parse(input_number)
|
parse_tree = parser.parse(input_number)
|
||||||
|
|
||||||
transformer = InputTransform()
|
transformer = InputTransform()
|
||||||
|
|||||||
Reference in New Issue
Block a user