question

Diego VG avatar image
0 Likes"
Diego VG asked Diego VG commented

Is it possible to resize an elevator bank through flexscript?

Good morning,

I would like to know if it would be possible to resize both in height and length (nb of lifts in the bank) an elevator bank by using flexscript. Of course I do know it is possible throught the drag arrows for resize but I wondered if we could do this through flexscript too and how.

Thank you very much for your help and have a nice year!

FlexSim 21.0.1
people moduleflexsim 21.0.1elevator bank
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

·
Pedro Ortelani avatar image
0 Likes"
Pedro Ortelani answered Diego VG commented

Good morning @Diego VG,

Yes, it is possible to resize objects with a 3D model via flexscript.

You can do it by getting the object reference, then casting it to be a Object, than you can access its size atribute and set size values to the x, y and z axis.

Here is an example on how to do it to a Elevator.

Model.find("Elevator1").as(Object).size.x = 100;

In this example I am resizing the Elevator on axis x to the value 100.

I hope that helps!

· 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.

Diego VG avatar image Diego VG commented ·

Good evening Pedro,

Thanks a lot four your answer. Unfortunately this is not what I am looking for. The object "Elevator Bank" from the People Module works slightly differently from any other object.

Whenever you modify the size by accessing the .size property or the .setSize method you modify the size of the yellow selection box while the elevator bank itself remains the same.

However, whenever you modify the size by using the drag arrows in the 3Dmodel window you are actually able to modify its real height reach (drag blue arrow while the elevator bank is selected) and the amount of elevators the bank is composed of (drag red arrow while the elevator bank is selected)

It is the second behavior that I would like to translate into flexscript.

In any case thank you for your answer and I hope these details may allow to clarify this issue.

Thanks again!

0 Likes 0 ·
Pedro Ortelani avatar image Pedro Ortelani Diego VG commented ·

Sorry, I understood it wrong!

Just checked this Elevator Bank object, I'm guessing that its 3D model was created via the Mesh API, maybe on the onDrag method, limiting its execution to only when you resize it through the arrows.

If that's the case, then I don't see a way to alter it via flexscript.

If you wish to learn how to handle the Mesh API, here's a link to an example:

https://answers.flexsim.com/questions/46673/how-to-use-mesh-api.html

I hope you find your solution soon!

0 Likes 0 ·
Diego VG avatar image Diego VG Pedro Ortelani commented ·

Thank you very much! I will give it a try and see if I may find another solution!

1 Like 1 ·

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.