🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Extent of Simlab

User: "Skull"
Altair Community Member
Updated by Skull

I want to rename a no. of bodies to a defined name after I import the parasolid into Simlab 14.1. And I am trying to automate the process.

 

For example, right now what i can do is change the name of 'Body 2' to 'xyz' through scripts. What i want is to get this input from user, like select the body to rename it to 'xyz'.

 

Is this possible in Simlab through the method of JScripts ?

Find more posts tagged with

Sort by:
1 - 12 of 121
    User: "tinh"
    Altair Community Member
    Updated by tinh

    I think you have to get names of bodies, and show them in a listview, then you can pick one to rename

    but I don't know how to do that by JScripts.

    User: "Rahul Rajan_21763"
    New Altair Community Member
    Updated by Rahul Rajan_21763

    Yes it is possible user defined names.We have utility functions in help page in scripting.

    <?xml version="1.0" encoding="UTF-8"?>scripting utilities.JPG

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    Yes it is possible user defined names.We have utility functions in help page in scripting.

    <?xml version="1.0" encoding="UTF-8"?>scripting utilities.JPG

    So i can get the input from user, prompt the userto select which body he wants to rename. 

    User: "Rahul Rajan_21763"
    New Altair Community Member
    Updated by Rahul Rajan_21763

    Yes it will prompt.

     

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    Yes it will prompt.

     

    Also. Lets take a basic example. There is a cube. And i want to fix one side of the cube. And i have to repeat this task for  many cubes with different sizes. 

     

    So is it possible in simlab that the simlab detects the face to be fixed automatically by giving something to the software to detect the face. 

     

     

    Also can you help me out with the way by which simlab number the different faces while importing parasolid. Or the process is random. 

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    Yes it will prompt.

     

    are you talking about creating the groups and prompting the user to select bodies to be part of that group. 

     

    Can i do this without creating groups?

    User: "Rahul Rajan_21763"
    New Altair Community Member
    Updated by Rahul Rajan_21763

    are you talking about creating the groups and prompting the user to select bodies to be part of that group. 

     

    Can i do this without creating groups?

    It is must to have group for this case.

    User: "Rahul Rajan_21763"
    New Altair Community Member
    Updated by Rahul Rajan_21763

    Also. Lets take a basic example. There is a cube. And i want to fix one side of the cube. And i have to repeat this task for  many cubes with different sizes. 

     

    So is it possible in simlab that the simlab detects the face to be fixed automatically by giving something to the software to detect the face. 

     

     

    Also can you help me out with the way by which simlab number the different faces while importing parasolid. Or the process is random. 

    You can use transfer groups here. Numbering of faces can be done internally by software.So it random.
    Create group for in the cube (CAD)
    Mesh it.
    Transfer the groups to the Mesh body
    If you give the Same group name for different cubes you can easily script this.
     

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    You can use transfer groups here. Numbering of faces can be done internally by software.So it random.
    Create group for in the cube (CAD)
    Mesh it.
    Transfer the groups to the Mesh body
    If you give the Same group name for different cubes you can easily script this.
     

    You are getting, what i am trying to do. 

     

    Let me try to tell you it in this way,

     

    Suppose i want to make a script, in which. When the user selects a body. A message box pops up stating the name of the body.  Is this possible in simlab?

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    You can use transfer groups here. Numbering of faces can be done internally by software.So it random.
    Create group for in the cube (CAD)
    Mesh it.
    Transfer the groups to the Mesh body
    If you give the Same group name for different cubes you can easily script this.
     

    I want to get the name of the body selected by the user in a variable , is this possible in simlab ?

     

    Like when i select a body , The body ID and body name  is shown in the output tab. So can i store that value in a variable ?

     

    User: "Skull"
    Altair Community Member
    OP
    Updated by Skull

    You can use transfer groups here. Numbering of faces can be done internally by software.So it random.
    Create group for in the cube (CAD)
    Mesh it.
    Transfer the groups to the Mesh body
    If you give the Same group name for different cubes you can easily script this.
     

    any help Rahul?

    User: "siddharth_dv"
    New Altair Community Member
    Updated by siddharth_dv

    Like when i select a body , The body ID and body name  is shown in the output tab. So can i store that value in a variable ?

     

    Hi,

     

    You can store the body name as parameters with the type as 'String'.

     

    var Mname = SimLabUtility.GetStringParameter('$ModelName')

     

    Once you have set is as a parameter , you can directly call the above function, the body name is stored in 'Mname' variable. The supporting file is present in SimLab help.

    When you are working on different cubes , upfront you set it as string parameter , you can make it work for different scripts.

     

    For creation of parameters you can go to option Project > Parameters , and set the values there. Attached screenshot for reference.

     

    Thanks

    Siddharth

     

    <?xml version="1.0" encoding="UTF-8"?>getdouble_parameter.PNG

    <?xml version="1.0" encoding="UTF-8"?>Parameter.PNG