algorithmic modeling for Rhino
A = New Grasshopper.Kernel.Expressions.GH_ExpressionParser(True).Evaluate("4<=3")._Bool
error: Invalid expression: Unexpected symbol encountered (=) (line: 1161)
Which is the right way to do this operation? It seems that the second Boolean operators are taken as strangers.
Thanks in advance.
Tags:
The expression language cannot handle operators of more than one character. You need to use the GH_ExpressionSyntaxWriter type to convert strings that people like to type into strings that the parser understands.
This, basically:
string exp = Grasshopper.Kernel.Expressions.GH_ExpressionSyntaxWriter.RewriteAll("4<=3");
A = New Grasshopper.Kernel.Expressions.GH_ExpressionParser(True).Evaluate(exp)._Bool
Incidentally if you just use GH_Convert.ParseExpression this is all done for you.
Great, thanks David :)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by