Jump to content

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
3 minutes ago, Rahul R said:

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

scripting utilities.JPG

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

Share this post


Link to post
Share on other sites
44 minutes ago, Rahul R said:

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. 

Share this post


Link to post
Share on other sites
19 hours ago, Rahul R said:

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?

Share this post


Link to post
Share on other sites
48 minutes ago, Skull said:

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.

Share this post


Link to post
Share on other sites
19 hours ago, Skull said:

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.
 

Share this post


Link to post
Share on other sites
On 8/31/2017 at 2:29 PM, Rahul R said:

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?

Share this post


Link to post
Share on other sites
On 8/31/2017 at 2:29 PM, Rahul R said:

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 ?

 

Share this post


Link to post
Share on other sites
On 8/31/2017 at 2:29 PM, Rahul R said:

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?

Share this post


Link to post
Share on other sites
On ‎9‎/‎2‎/‎2017 at 0:30 PM, Skull said:

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

 

getdouble_parameter.PNG

Parameter.PNG

Rahul R likes this

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...