Measurement of distance

Hello Anybody,
I would like to ask you, where, in the tree, can I see a measured distance? I want to measure a length of one ligament, so I added this code:

AnyKinPLine distance1 =
{
AnyRefFrame &Node= .GlobalRef.G_Radius_Radioscaphocapitate_Origin;
AnyRefFrame &Insertion_Radioscaphocapitate = .Segs.WristScaphoidB.Insertion_Radioscaphocapitate ;
//AnyRefFrame &<Insert name2> = <Insert object reference (or full object definition)>; You can make any number of these objects!
};

Have a nice day
Veronika

Hi Veronika,

You should be able to see the object in the tree with the name

“distance1” in this object it will have a “Pos” variable this is the length

To find the object in the tree
[ol]
[li]Load model
[/li][li]Find distance object in script
[/li][li]Right click distance1
[/li][li]Select “Locate in modeltree”
[/li][/ol]

Best regards
Søren

Dear Soren,
Thank you very much for your answer. Everything is ok now. I have only one small question.
I need to use this measured distance in one script again. I tried to right click on this Pos in modeltree and choose Insert object name. But then, there is an error.

AnyLigamentModelPol LigModel1 = {
L0 = Main.HandModel.distance1.Pos; // Slack length
eps1 = 0.2; // Strain where F1 is valid
F1 = 1000; // Force in the ligament at strain eps1
};

ERROR(SCR.EXP10) : ‘L0’ : Expression evaluation failed at moment ‘DesignVar’ :
distance1.Pos : argument will not be ready for evaluation until moment ‘PosVar’

Is it somehow possible to do it in this way? Without doing it mechanicaly?

Thank you very much again
Veronika

Hi Veronika,

It is not possible to write like you do as the also error indicates

L0 needs to be set when model is loading, it is a design variable so it needs to be something which can be extracted from the script defined and not from running an analysis, the Pos variable will get it value only after having executed an analysis.

So you need to run the model then dump the value of the L0 and set it to this value.

There are also calibration studies availble for doing this type of task please see
http://www.anybodytech.com/fileadmin/AnyBody/Docs/Tutorials/chap5_Muscle_modeling/lesson7.html

Best regards
Søren

Thank you very much Soren. You are my hero! :slight_smile:

Have a nice day
Veronika:)