Segments

Hello,

I am trying to modify the “SegmentsLumbar.any” file located in the AAUHuman/Trunk/ directory. When I define a segment property, i.e. mass, for a new segment (Mass = 1) I get the error ‘Mass’ : Unresolved object. However, if I write it as full path,

Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.NewSeg.Mass = 1;

Everything is good. What is the problem here?

Kind regards,

Rıza.

Hi Riza,

that sounds as if you have placed the Mass = 1 statement at the wrong place in the AnyScript. If you want it to define in the Main.HumanModel.BodyModel.Trunk.SegmentsLumbar.New Seg object, you have to make sure that you define it inside this segment. By using the full path you specified the object in the segment directly.

Best regards,
Daniel

Hi Daniel,

Thank you for the reply. I am sure that I defined it under the new segment definition. It is also not only about mass, but all segment properties. Could it be another thing causing this?

Kind regards,

Rıza.

Hi Riza,

no, it’s a pure syntax problem. You need to be in your object folder to be defining some members, e.g.:



AnySeg NewSeg = {      // CORRECT
  Mass = 0;
  Jii = {0, 0, 0};
};

OR
Main...SomePathHere...NewSeg = {      // CORRECT
  Mass = 0;
};

NewSeg.Mass = 0;  // CORRECT

AnyFolder &ref = NewSeg;
ref = {
Mass = 0; // CORRECT
};


Mass = 0; // WRONG


It is also typically not recommended to modify the files in the repository - since once they are changed we cannot help in answering your questions.
Most of the time you can add new segments within an application and do not need to modify the repository itself.

Regards,
Pavel

Hi Pavel,

It seems that I have mistaken. The problem was that I put the mass comment inside the AnyDrawSurf DrwSTL command when defining the new segment. It is fine now. Thank you.

Regarding your suggestion, could you please provide some information?
I should mention that I am currently adding new segments (thoracic vertebrae) instead of ThoraxSeg in the human model. Do you suggest me to create a new script to store new segment information? I tried going with the standing human application, but it still refers back to SegmentsLumbar.any file.

Kind regards,

Rıza.

Hi Riza,

Yes, I would take a StandingHuman model and add changes to the Model folder first. Just to make sure it works before you go into the human body model inside of the repository and apply changes that may explode there :slight_smile:

Just make a separate file that will introduce thoracic vertebrae, all relevant constraints, muscle objects, etc. And then include it into the Standing Human model.

For the actual inverse dynamics analysis you will need to exclude the mechanical objects from the previous thoracic model (you can use MechObjectExclude member of the AnyBodyStudy class). This way everything can be added from your model and without modifying the repository itself in a dangerous manner.

This also makes it easy to share the model for debugging with us or your colleagues. You can just package the add-on and send it.

I hope this makes sense.
Let me know if you have any other questions.

Regards,
Pavel