question

Simone F avatar image
1 Like"
Simone F asked Simone F commented

Set the robot size using a script

Hi,

I'm trying to resize a robot in my model using a script. I've tried to use the method that i generally use for all the objects:

Object obj = Model.find("Robot1");
double x = 0.5;
double y = 0.5;
double z = 0.5;
obj.setSize(x, y, z);

This operation doesn't work for the robot (the values in the properties are changed but the real robot dimensions in the model aren't).There is a solution for this problem?

FlexSim 21.0.0
robotflexsim 21.0.0scriptsetsize
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Matthew Gillespie avatar image
5 Likes"
Matthew Gillespie answered Simone F commented

You need to call applicationcommand("resizesubcomponents", obj) after changing the size.

Object obj = Model.find("Robot1");
double x = 0.5;
double y = 0.5;
double z = 0.5;
obj.setSize(x, y, z);
applicationcommand("resizesubcomponents", obj);


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Simone F avatar image Simone F commented ·

Hi, thank you for your answer and for your time. This works fine! I've noted that is possible obtain the same result setting just one size coordinate like:

Object obj = Model.find("Robot1");
obj.size.x=0.5;
1 Like 1 ·