Error: Moment of Evaluation

When I try to rum my model I get following message:
ERROR(SCR.EXP10) : D:/User/H…e/A…0/Body/A…n/Arm/HumerusMuscleGeometry.any : ‘sRel’ : Expression evaluation failed at moment ‘DesignVar’ :
D:\User\Hauke\AMMRV1.0\Body\AAUHuman\Arm\HumerusMuscleGeometry.any(13) : art_gh_hum.Axes : argument will not be ready for evaluation until moment ‘PosVar’

My code looks like this:

 AnyVec3 x1y1z1 =({x1_s1,y1_s1,z1_s1}*Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Humerus.art_gh_hum.Axes);

...

AnyRefNode I_subscapularis_1        = {sRel = .Scale({-0.013538, 0.013190 , -0.033056}+.ds2)*.Mirror+ .art_gh_hum.Offset_subsc+.art_gh_hum.x1y1z1;      
                                                    ARel= RotMat(.art_gh_hum.Radius_subsc_Offset_y_r *pi/180, y) * RotMat(.art_gh_hum.Radius_subsc_Offset_z_r *pi/180  ,z);
                                                    AnyDrawRefFrame  drw={};
                                                   };

I tried to solve sRel on the outside in an extra file, but no change. My first guess was the vector, but as Offset_subsc is a vector as well, thus that might not be the source of evil.

I’d appreciate ur help :slight_smile:

Hi Haukeee

When calculation the x1y1z1 property you make used of the object

Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Humerus.art_gh_hum.Axes

this is the rotation matrix of the node on the humerus, the Axes property is the instant value of rotation matrix.

This means that you can not use this value for setting a postion of a node which you are doing later in the script when you try to set the sRel value.

When loading a model and running it, there are a number of evaluation moments, in this case the error is that you are trying to set the value of a design variable (sRel) with a value which originates from “PosVar” (position) in this case the Axes property of the node.

In other words: When the model is constructed at load time it can not be based on position information which is not calculated yet.

In the present case you could maybee have used Axes0 instead of Axes this would have loaded without problem, but i am not sure if you really wnatd to use the instant value for some reason. Axes0 is the initial rotation matrix and it is known at load time.

Best regards
Søren

Hi Soeren,

thank you. I expected something like that. Unfortunatly the axes I am refering to belong to a node and Axes0 can just be used for segments. I suppose I have to add a segment which acts as my ref system.

Hauke

But why can run the code if I don’t add vector x1y1z1 in SRel, but still calculate the vector above in my text.
If it is a problem with having no values for the axis, AnyBody shouldn’t do the calculation.
It just becomes a problem when I add the translation in sRel.

If you need more code to understand my problem, I’ll upload it.

Hi,
basically its, like Søren said a problem of initialisaton time. If you don’t give a sRel, it will be automatically set to 0,0,0. Please write again with an example if this answer is not enough.
Best regards,
Sebastian