[LEFT]Hi Maria,
If you often want to use a specific chart setup for a model you have two different ways of doing this in AnyBody. You can either set up an AnyBody Workspace where you have a chart open with the specific setup that you want, or you can define the chart you want in AnyScript and use the AnyProject functionality to open the chart (from the Project tab of the Tree pane).
I have created a very small example of how to do this (based on the AnyProject classexample included with the AnyBody installation).
The example uses the Demo.Arm2D.any model from the classexamples, but it can easily be modified to be used with whatever model you’re using.
The concept is that you define an AnyChart in AnyScript and use it to define all the nondefault settings that you want it to have. For this example I have specified 2 series with a vector of RGB values for each (in order to give all values for each series the same color).
I have also specified autoscaling of the axis to be off for both abscissa and value axis.
In order to display this AnyScript-defined AnyChart, I have created an AnyProject which has an Output folder containing an AnyProjectChart which can be used for opening or setting this AnyChart.
I have included the code below:
[/LEFT]
Main = {
[SIZE=3]#include[/SIZE] “Demo.arm2d.any”
[SIZE=3]AnyChart[/SIZE] Chart_MaxActivity =
{
Visible = Off;
Series =
{
[SIZE=3]AnyChartSerie[/SIZE] Serie1 = {
Abscissa = “Main.ArmModelStudy.Output.Abscissa.t”;
Value = “Main.ArmModelStudy.Output.Model.Muscles..Activity";
Lines =
{
Visible = On;
[SIZE=3][/SIZE]RGB[SIZE=3] [/SIZE]=[SIZE=3] [/SIZE]{{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0},{0,1,0}};
};
};
[SIZE=3]AnyChartSerie[/SIZE] Serie2 = {
Abscissa = “Main.ArmModelStudy.Output.Abscissa.t”;
Value = "Main.ArmModelStudy.Output.Model.Segs.UpperArm..r[0]”;
Lines =
{
Visible = On;
RGB = {{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0},{1,0,0}};
};
};
};
AbsAxis =
{
Visible = On;
AutoMin = Off;
AutoMax = Off;
Min = 0.25;
Max = 0.75;
Title =
{
Visible = On;
Font =
{
RGB = {0, 0, 0};
FontName = “Times New Roman”;
Height = 20;
Width = 8;
Bold = Off;
Italic = Off;
BillBoardView = On;
ModelSized = On;
ModelScaleHeight = 1;
ModelScaleWidth = 1;
};
Text = “Abscissa”;
};
Unit1 =
{
Visible = On;
AutoUnit = On;
Divisions = 5;
Unit = 0.025;
TickInside = 0.05;
TickOutside = 0;
GridLines = Off;
GridLineStyle =
{
Style = Line3DStyleFull;
Thickness = 1;
RGB = {0.25, 0.25, 0.25};
};
Text = On;
TextFont =
{
RGB = {0, 0, 0};
FontName = “Times New Roman”;
Height = 20;
Width = 8;
Bold = Off;
Italic = Off;
BillBoardView = On;
ModelSized = On;
ModelScaleHeight = 1;
ModelScaleWidth = 1;
};
TextSpace = 0.05;
NumberFormat =
{
Digits = 1;
Style = 0;
Scale = On;
ScaleVal = 1;
};
};
};
ValueAxis =
{
Visible = On;
AutoMin = Off;
AutoMax = Off;
Min = 0.00;
Max = 0.15;
Title =
{
Visible = On;
Font =
{
RGB = {0, 0, 0};
FontName = “Times New Roman”;
Height = 20;
Width = 8;
Bold = Off;
Italic = Off;
BillBoardView = On;
ModelSized = On;
ModelScaleHeight = 1;
ModelScaleWidth = 1;
};
Text = “Value”;
};
Unit1 =
{
Visible = On;
AutoUnit = On;
Divisions = 5;
Unit = 0.025;
TickInside = 0.05;
TickOutside = 0.0;
GridLines = Off;
GridLineStyle =
{
Style = Line3DStyleFull;
Thickness = 1;
RGB = {0.25, 0.25, 0.25};
};
Text = On;
TextFont =
{
RGB = {0, 0, 0};
FontName = “Times New Roman”;
Height = 20;
Width = 8;
Bold = Off;
Italic = Off;
BillBoardView = On;
ModelSized = On;
ModelScaleHeight = 1;
ModelScaleWidth = 1;
};
TextSpace = 0.05;
NumberFormat =
{
Digits = 1;
Style = 0;
Scale = On;
ScaleVal = 1;
};
};
};
};
[SIZE=3]AnyProject[/SIZE] ArmProject = {
Output = {
[SIZE=3]AnyProjectChart[/SIZE] MaxActivityChart = {
Chart = &Main.Chart_MaxActivity;
};
};
};
}; // Main