We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-02-23 07:59 PM
Help please! I've modified Archicad's "Spotlight Kit 25" Lamp object to rotate along its "Y" axis. But when I rotate it, one of its original elements gets duplicated, as if I made a copy as I was rotating.
The object from the screenshot has been rotated 15deg around its "y" axis and 15deg around its "x" axis.
FYI: I'm not a programer but I managed to add the new parameter to the interface and all, I just can't get this "duplicated" element to disappear, I'm sure I copy-pasted some code line without really understanding what it does and that is generating this issue.
On a separate note, why can't I rotate around the Y axis by default?
Solved! Go to Solution.
2022-02-25 10:09 AM - edited 2022-02-25 10:10 AM
From my understanding, the EPS lines will not be the ones giving you the precision error as it only turns up when you use equals. Rounded, it might be equal, but in reality it may not. Hence < EPS is used as it is essentially zero without actually being zero.
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2022-02-25 01:10 PM
I checked on my pc and it is indeed the lines with if bProject2D & ABS(rotAngleX)& ABS(rotAngleY) < EPS then that are generating the error.
My guess is that since bProject2D is a boolean and it is evaluated as a number as its value is checked against EPS Archicad treats is as a real number.
and since this line compares a real to a float you get this warning.
2022-02-28 02:15 AM
So the opposite problem? So to get rid of it you would have to split out the bProject2D = 0?
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2022-02-28 08:41 AM
There is no problem.
The error message is a generic one, it just points out that you use different types at the same time, it's just a warning. In this case it doesn't matter and won't cause any problem.
2022-02-28 10:27 AM
Generic and annoying as hell... In one of my objects, the only way I have figured out how to get rid of it is to change all of my A = B to B - EPS < A < B + EPS... What is more annoying is that A and B are defined by condition statements earlier in the script, defining them as equal or not so that I can use a single SUB. Just fills my error report with junk...
AC22-23 AUS 7000 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win10 | R5 2600 | 16GB | GTX1660 |
2022-03-02 10:00 AM - edited 2022-03-02 10:03 AM
Probably you wanted to write
... ABS(rotAngleX) < EPS & ABS(rotAngleY) < EPS ...
& has lower precedence than < so
ABS(rotAngleX) & ABS(rotAngleY) < EPS
is really
(ABS(rotAngleX)) & (ABS(rotAngleY) < EPS)
where ABS(rotAngleX) is a real number tested as a boolean, so the warning is legitimate.
2022-03-02 10:22 AM
Hi Peter, yes I thought it would be evaluated as the first line you wrote.
Since it worked written like this I didn't think twice about it.
Thanks for the clarification.
2022-03-02 10:24 AM
The parameters of ROT are
ROT x, y, z, alpha
a vector to rotate around, not angles in order, and it is an error if you omit some.
Do you know about some legacy command that isn't in the reference guide?
2022-03-22 04:01 PM
Sorry for my late response. Thanks for all the help from everyone. I tried your suggestion of using < if bProject2D & (ABS(rotAngleX)) & (ABS(rotAngleY) < EPS) then > but I still get that minor warning, I wonder if I inserted the code incorrectly.
2022-03-23 12:08 AM
What you have written above is still wrong. You need to check both rotAngleX & rotAngleY against EPS separately. Effectively what you have is three arguments you want to test against so you should split it into three lines (using the line continue character "\") so its easier to see the logic.
Your current logic looks like this:
if bProject2D \
& ABS(rotAngleX) \
& ABS(rotAngleY) < EPS then...
in extended form this reads as:
if bProject2D = 1 \
& ABS(rotAngleX) = 1 \
& ABS(rotAngleY) < EPS then...
So the "real value" error is coming from the second line.
You need to write this:
if bProject2D \
& ABS(rotAngleX) < EPS \
& ABS(rotAngleY) < EPS then...
Which is what Peter described above.