Import Stl File to already Existing Model

Hi sir,
How Can i Import any stl file in already created model…if draw segments are not mentioned in the scrpit???:confused::confused::confused:

Hi,

Sorry for not understanding your problem completely. Could you give a more detailed description of what you would like to do and where you got stuck?

In general, to import and use an stl file into the model, there are different ways depending on what you want to do.

[ul]
[li]If you only want to see the stl, you can create an object of the class AnyDrawSurf or AnyDrawSTL. The descriptions of these classes and examples you can find in the reference manual.[/li][li]If you want to use the stl for anything, e.g. contact modelling or scaling, you can create an object of the class AnySurfSTL. To visualize this object, you have to add an object of the before mentioned classes.[/li][/ul]
Best regards,
Daniel

Sir,
I simply want to attach an stl file for eg : dumbell in the hands of a standing person in the standing motin.

Hi,

in that case you can follow my hints from the first bullet-point. You can also look at the example Demo.Arm2D.Mus3E from the reference manual where a dumbbell is attached at a hand node of the Demo.Arm2D model.

Best regards,
Daniel

Sir,
Thank you for the information but i used AnyDraw Segment in the model it was not acceptable during loading and i want to know the exact Syntax for writing the command in any other model as well…Like in tutorials its mentioned for attaching in forearm section…if forearm section is not mentioned in a particular model for eg : person is sitting on a wheel chair and i want to attach dumbell to his hands.

Hi Deepa,

you have to find the segment you would like the dumbbell to. You can do this using the navigation facilities in AMS, e.g. by double clicking something in the ModelView window. You can find a very good and compact description of the possibilities to navigate in AMS on the AnyBody youtube channel, http://www.youtube.com/watch?v=MQsUUdoKsGg&list=TLTH1C_ojLYnEEuPFCWBPGJn9FXpdUu8AT.

As an example, I attached a dumbbell to the glove of a standing model like this:

    
Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Glove = {
      AnyRefNode dumbbell = {  
        ARel = RotMat(pi/2,z);
        AnyDrawSurf drw = {
          FileName = "Model/dumbbell";
          ScaleXYZ = {1,1,1} * 0.001;
          
        };
      };
    };

The glove is a segment defined as an interface of the hand because the hand has many segments describing the different segments of a hand. I hope you can adopt this example to the model you are using.

Best regards,
Daniel

Thank you sir… will try attaching it to some other model as well.

Hii Sir,
I tried doing it using your given syntax but
ERROR(OBJ.FILE1) : C:/U…s/v…a/A…a/R…g/A…y/A…x/A…o/Body/A…n/Arm/Glove.any(10) : drw.FileName : Problem with file : C:\Users\vijay meena\AppData\Roaming\AnyBody Technology\AnyBody.6.0.x\AMMR.v1.6.2-MyDemo\Body\AAUHuman\Arm\Model\dumbbell : Neither STL nor ANYSURF file is found.
is displayed what does this mean???:confused::confused

Hi Deepa,

this means that there is no surface file (.stl or .anysurf) in the mentioned folder. If you don’t specify an absolute directory (starting e.g. with c:…), the system will search for the surface file in the same directory as you as the file where you defined your object is in.
And another comment: it looks as you opened the file where the glove is defined to write the definition of the surface. This file is part of the body model (meaning somewhere below the Body folder, here Body\AAUHuman\Arm\Model). I would recommend to leave the body model untouched if possible because it is commonly used by all the examples in the AMMR, meaning in your case each example model having the arm included would have a dumbbell in the hand. It is possible to open a folder of the model tree from any other location in the model. You could e.g. put the code below into the main file. In this case, you have to copy the dumbbell.stl file into the folder of your main.any file and not into the body model. If you look at the folder structure of your example, you can see that there is a sub-folder Model. Best practice is to find or create an .any file in this Model folder and do the definition there. How to use include files is described in the tutorial http://www.anybodytech.com/fileadmin/AnyBody/Docs/Tutorials/chap7_Advanced_script_features/lesson2.html

Hope I didn’t confuse you even more.

Best regards
Daniel

:confused::confused:
okay …

…that’s not very helpful to figure out what exactly is your problem.

[ul]
[li]Which model are you working on?[/li][li]Have you copied the .stl file or .anysurf file you want to use somewhere into the model folder?[/li][li]In which file have to written the definition of the AnyDrawSurf object?[/li][li]Are you familiar with the concept of #include statements described in the tutorial I send you?[/li][li]At which state of the explanation did I loose you?[/li][/ul]
Regards,
Daniel

Sir,
will you please attach the file in which u have made the changes so that i can compare it with mine ones…

I am working on standing model.
I have made changes in glove segment ( model, human body,right ,arm, glove)
actually i have copied the stl files as well

I just put it somewhere in the .main.any file of a clean model created from an body model template, e.g. at the end of the block


AnyFolder Model = {  
...
};

I copied the .stl file into the directory of the main file.

Sir
it is not working even after including the stl files and copying them in the same

Hello Deepa,

here is the main.any file of a new created model using the Human Standing template:


#include "../libdef.any"

Main = {
  // ----------------------------------------------------------
  // Model configuration:
  // For more info on body model configuration options please load the model and double click on: 
  // #include "<ANYBODY_PATH_BODY>\Documentation\BodyModel.parameters.any"
  // ----------------------------------------------------------  
  
  //If you want to use your own draw settings, please outcomment the next line
  //#path BM_DRAWSETTINGS_FILE "Model\DrawSettings.any"
  
  // Using your own Mannequin.any file in the Model folder of your model
  #path BM_MANNEQUIN_FILE "Model\Mannequin.any"
  
  // Include default human model
  #include "<ANYBODY_PATH_BODY>\HumanModel.any"
  
  AnyFolder Model = {  
    // A link to the human model
    AnyFolder &HumanModel=.HumanModel.BodyModelWithDefaultDrivers;
    
    // Environment files are used to include objects surrounding human, e.g. global reference frame
    #include "Model\Environment.any"   
    
    AnyFolder ModelEnvironmentConnection = {
      // This file contains all joint and foot reaction forces to simulate standing human
      #include "Model\JointsAndDrivers.any"
    };
    
    Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Glove = {
      AnyRefNode dumbbell = {  
        ARel = RotMat(pi/2,z);
        AnyDrawSurf drw = {
          FileName = "Model/dumbbell";
          ScaleXYZ = {1,1,1} * 0.001;
          
        };
      };
    };
    
  };
  
  AnyBodyStudy Study = {
    AnyFolder &Model = .Model;  
    Gravity={0.0, -9.81, 0.0};
    nStep = 11;
    
    // these settings are needed for adding drivers without removing the default set 
    Kinematics.SolverType = KinSolOverDeterminate;
    InitialConditions.SolverType = Kinematics.SolverType ;
    
  };
  
  #include "Model\RunAppSequence.any"
  
}; //Main

If you copy the file dumbbell.stl into the Model sub-folder of the model, it should work.

As another example, you can have a look at the BergmannGH model in the validation folder of your AMMR. It is an upper extremity model including a dumbbell. This you can also use to compare to your model and maybe copy the construction.

Best regards
Daniel

Thank you sir . :slight_smile:

hai everyone…

can you share what you have done in the format of .any here…

im really appreciated