for postprocessing i calculate some distances, angles and so on. As the formulas would become too long for one line (How many digits are allowed? Is an extension to the next line possible?) i create interim values which are visible in the model tree. As they are of no importance: Can they be hidden? Is this a good way of programming? (I ask this because i am not aware of such interim values in the original unchanged repository.)
In order to avoid new duplicate variables i want to use references, but this results sometimes in the error that
“References can only be made for folder-objects (derived from AnyFolder), not value-objects (derived from AnyValue). This error may arise when a value-class is used as reference class.”
Why can’t (how can) i define a reference to a position vector:
I’m not even sure that there is a limit of digits. I have never reached it, you can at least use more than a thousand digit in a line.
But this is not readable, so yes you can extend a formula to the next line. There is nothing special to do, just jump to the line after an operater. As long as there is no semicolumn the system see it as one same line. It can looks like this:
AnyVar Var1 = Var2*
Var3;
The interim values are ok to use as long as there are not too many of them. Then it can make the code hard to read and understand. You cannot hide them in the model three, but you can put them in a folder (for the model three) or in an include file so the code is not so heavy.
Then for the references, as the error mesage says, they can only be made for folders. The AnyValues you actually don’t need references, you can just set a value to be equal to another. So your example becomes simply the following (without “&”):