question

Julius J2 avatar image
0 Likes"
Julius J2 asked Ryan Clark commented

How to set the rail length of ASRS vehicle using Flexscript

Hi! I want to set the rail length and also the beam height of an ASRSvehicle using Flexscipt. Is there a way to do that? Thanks.

FlexSim 21.2.0
flexscriptasrsasrs vehicle
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Julius J2, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann edited

The rails and beam are components of the ASRSvehicle and can be accessed as objects through "object.attrs.drawsurrogate.subnodes[]". The names/ranks needed to access the correct component can be seen in the animation editor.

1648714304092.png

Once you have a reference to the object you can set the size (and other properties) like you would with any other object (object.size.x/y/z).

As an example, the code in the script window in the attached model, randomizes both the rail lengths and the beam height. Note, that the ladder is part of the "Car" component, which you might want to adjust together with the beam size.

// Randomize the length of rails
double rand = uniform(10, 40);
Object lowerRail = ASRS.attrs.drawsurrogate.subnodes["BottomRail"];
Object upperRail = ASRS.attrs.drawsurrogate.subnodes["TopRail"];
lowerRail.size.x = rand;
upperRail.size.x = rand;

ChangeASRSByCode.fsm


1648714304092.png (59.2 KiB)
5 |100000

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