Is Rhinoceros unable to perform mathematical calculations in the text expression field directly or is there an error in the expression syntax used? Please help sir, thank you sir
Hi jack,
PointCoordinate returns a string. You can convert that to a float with a Python function like this:
%<float(PointCoordinate(“ObjectID”,“X”))*10>%
Jess
Hi, Mr. Jess,
I had previously tried the float method, but your answer above hadn’t occurred to me at all. You are truly clever and generous. May God bless you, sir, Words cannot fully express how grateful I am for your assistance. sir.
Mr. Jess
.
I apologize, sir. I have another question. I hope this is the last one and that I can understand the concept of this text field syntax/formula.
.
So, for the result of the previous syntax/formula (text), I want to subtract it from the value of other coordinate points. What would the formula be, sir?
.
However, I want the result displayed in the text to be the result of subtracting the two coordinate point values. I apologize if I have asked many questions before, sir. It’s not that I am unwilling to think or find out on my own, but rather that I have tried and am at a dead end. I kindly request your assistance, sir. Thank you very much.
Hi jack,
no problem
It can be confusing mixing text variables and Python:
%<(float(PointCoordinate("a4838d98-5e71-426e-a161-74106ff4163c","Z")) - float(PointCoordinate("ffb850d6-e9bd-4982-8a37-67ee2c8de726","Z")))*10>%
Depending what you want to do you may also use history and standard dimensions snapping to the points. Have a look at the attached file and edit the point locations.
Jess
TextFieldMath_jM.3dm (36.4 KB)
Mr. Jess.
.
Thank you very much, Sir. I am beginning to understand the concept of how text fields work, especially with floats. This is valuable foundational knowledge that I’ve gained from you, and it will inspire me to study even harder. May God bless you.