Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Fixed CQGI so that it handles ints and floats and not just floats.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwright committed Oct 13, 2017
1 parent 6386f05 commit d81c265
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cadquery/cqgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ def set_value(self, new_value):

if self.varType == NumberParameterType:
try:
f = float(new_value)
# Sometimes a value must stay as an int for the script to work properly
if isinstance(new_value, int):
f = int(new_value)
else:
f = float(new_value)

self.ast_node.n = f
except ValueError:
raise InvalidParameterError(
Expand Down

0 comments on commit d81c265

Please sign in to comment.