I would suggest you to go through the scaling tutorial to make personalized models for your subject. Just changing the stl file will not scale the model, so you will end up visualizing the bone drawing that doesn't match the segment length or the nodes on the segment.
If you only want to visualize the bone, you can make a new AnyDrawSurf object in the leg to see the new stl file. To do that, you can open the scope to the leg in your model. You don't need to make changes to the body model files (Seg.any). So, you can go to your SubjectSpecificData.any file and type:
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh = {
AnyDrawSurf NewFemur = {
FileName = "__.stl"; // please type your stl file name here with the relative path to the stl file from the folder containing SubjectSpecificData.any
};
};
Seg.any is made in such a way that it is reused for right and left side, so if you change something over there, it will be implemented on both right and left side. However, if you are using AMS v7.4.1 or later, you can use the "??=" operator instead of "=". This operator allows you to set some default value when you create an object with option of overwriting the value somewhere else in the model. So, in your Seg.any for the leg model, you can replace FileName = with FileName ??= for the bone drawing. This will take the default value as those specified in Seg.any. And then, you can overwrite the filename for the right side somewhere else in your model by typing:
Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh.Drw3.FileName = ".stl" // complete path to your stl file
Likewise, you can do for other objects in AnyDrawSurf, like ScaleXYZ, RGB, etc.
The error you are facing is because the compiler expects Main = { to compile the model and instead finds Main.
Essentially, when you include a file in the Main file of a mocap model, you are working outside the scope of Main = { }; (that is defined inside #include "<ANYMOCAP_MODEL>"). Your code is trying to point to something in your model but it exists outside of Main = { };. This is not allowed. You can resolve the error by including your file in another place (for example, Trial/Subject/LabSpecificData.any) or by rewriting the code slightly to open the scope of Main before your additional code:
Main = {
Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh = {
AnyRefNode implant Node=
// Please note that your code has a space
// between implant and node. This is not allowed.
{
sRel = 0.001*{5, 0, 2};
...};
};
};