question

anon-user avatar image
0 Likes"
anon-user asked anon-user commented

script more simply.

I want to write a script more simply.


I created a script to move the position of Processor1 10 meters in the X direction.

There are two lines, but is there a way to put them together in one line?



Object obj = Model.find("Processor1");

obj.location = obj.location + Vec3(10,0,0);





FlexSim 20.1.3
flexsim 20.1.3flexscriptscript
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

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered anon-user commented

Try:

Model.find("Processor1").as(Object).location.x+=10;

· 3
5 |100000

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

anon-user avatar image anon-user commented ·

Thank you! It was very helpful!

Is it possible to write x + = 10, y + = 10, on one line?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ anon-user commented ·
Model.find("Processor1").as(Object).location+=Vec3(10,10,0);
0 Likes 0 ·
anon-user avatar image anon-user Jason Lightfoot ♦ commented ·

Thank you!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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