mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 10:06:47 +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):
|
||||
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
|
||||
if not is_valid:
|
||||
self.report({"WARNING"}, "The number typed is not valid.")
|
||||
|
||||
@@ -2336,7 +2336,7 @@ class MeasureTool(bpy.types.Operator):
|
||||
|
||||
def recalculate_inputs(self, context):
|
||||
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
|
||||
if not is_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")
|
||||
|
||||
@classmethod
|
||||
def validate_input(cls, input_number):
|
||||
def validate_input(cls, input_number, input_type):
|
||||
|
||||
grammar_imperial = """
|
||||
start: FORMULA? dim expr?
|
||||
@@ -565,6 +565,10 @@ class Snap(bonsai.core.tool.Snap):
|
||||
parser = Lark(grammar_metric)
|
||||
factor = 1
|
||||
|
||||
if input_type == 'A':
|
||||
parser = Lark(grammar_metric)
|
||||
factor = 1
|
||||
|
||||
parse_tree = parser.parse(input_number)
|
||||
|
||||
transformer = InputTransform()
|
||||
|
||||
Reference in New Issue
Block a user