Set the robot size using a script

Set the robot size using a script

simone_f1
Not applicable
12 Views
2 Replies
Message 1 of 3

Set the robot size using a script

simone_f1
Not applicable

[ FlexSim 21.0.0 ]

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?

Accepted solutions (1)
13 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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);




Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

simone_f1
Not applicable

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;