We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-10-09 07:55 PM
IF WALL_SKINS_PARAMS[i][6] = 3 THEN
• [6] core status
core status: 0 - not part, 1 - part, 3 - last core skin.
Solved! Go to Solution.
2022-10-09 11:35 PM
This is generated when using = to compare REAL values. It works with INTEGERS but GDL is prone to false results for Real values due to precision.
The usual workaround in your coding is:
EPS = 0.0001 !or some other small value to suit your object
IF ABS (WALL_SKINS_PARAMS[i][6] - 3.00) < eps THEN...
this way if the divergence between values is less the EPS then the result will be TRUE, and any value greater than 3.00 will be FALSE
2022-10-09 11:35 PM
This is generated when using = to compare REAL values. It works with INTEGERS but GDL is prone to false results for Real values due to precision.
The usual workaround in your coding is:
EPS = 0.0001 !or some other small value to suit your object
IF ABS (WALL_SKINS_PARAMS[i][6] - 3.00) < eps THEN...
this way if the divergence between values is less the EPS then the result will be TRUE, and any value greater than 3.00 will be FALSE
2022-10-10 03:35 AM
So is this real value?
I understand it as an integer....
Is INT(WALL_SKINS_PARAMS[i][6]) = 3 ok?
2022-10-10 04:48 AM
You would expect the core to be an integer (0, 1 or 3), but because WALL_SKINS_PARAMS can also tell you the skin thickness, the entire parameter is probably treated as a real number (just my guess).
So the core value (although it may be exactly '3') is also treated as a real number, which means it could have a decimal precision.
You are then trying to compare something that may have a decimal precision with something that does not - hence the message to say "Use of real types can result in precision problems".
In this case it is just a warning and can probably be ignored - you will only see it when checking the script.
Or it is a case of scripting as DGSketcher suggested to allow for a small decimal range (error).
Barry.
2022-10-10 05:44 AM
thank you so much
2022-10-14 10:34 AM
In this case, when the stored value is surely an integer, round_int might be easier to read.
2022-10-14 11:14 AM
@Peter Baksa Thank you for your guidance. I had forgotten that option. Might need to review some of my coding... 👍