Hello,
I have a question reagarding the implementation of values into AnyBody. Is there an option to upload values like out of excel into it? Like the AnyOutputRef Option for the output from AnyBody to excel in the other direction. (At the moment I implement angle values as a group manual into my drivers. I don't use motion analysis with markers or a sensor technology.)
You can load tabulated data (.txt or .csv) into your model using the AnyInputFile class.
The AnyMocap Framework does this for transfering joint angles from the marker tracking study to the inverse study.
Here is a snippet that takes a column of data from a file and uses it in a interpolation driver.
AnyKinEqInterPolDriver Actuator = {
AnyRevoluteJoint &Jnt = Main.SliderCrank.Jnts.Shaft;
Type = PiecewiseLinear;
Data = data.Data;
T = data.T;
AnyInputFile data = {
FileName = "data.txt";
};
};
If you need to output tabulated data from anybody you can use the AnyOutputFile class.
That would look something like:
AnyOutputFile OFile2 = {
FileName = "data.txt";
// You can reference as many variables as needed - read the class documentation for advanced options for searching multiple variables and formatting the file.
AnyVar var1 = .MyMeasure.Val;
};
one more question regarding AnyOutputFile.
Sorry, if I missed something.. I had not find anything that helped me further.
It works that I get some output but I don't know, what I can do that for example the Moment isn't in the same line like the Force in the excel sheet. At the moment everything is in one line/row. I want to have it in different rows, when I define the AnyFloat new.
I am not sure I understood your question well, but if you try to write compressive components first, then shear ones, then moments, for example.
You can specify them in the needed order:
In the output file you will get the following table:
t, L1L2Compr, L2L3Compr, L3L4Compr,...L1L2Shear, L2L3Shear, L3L4Shear,...
0, X0, Y0, Z0,...
...
tEnd, Xend, Yend, Zend, ...
Alternatively, you can write data as is and tweak your Output interpretation to use indices on the data, which might be easier.