question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Axel Kohonen commented

How do I get the distance along the conveyor in code?

Hi,

I would want to get the distance along conveyor value of a conveyor station using FlexScript. How do I get it?

I managed to set the value using the example in the forum, but I cannot figure out how to do it if I only want to get the value instead of setting it.

Thank you!

Kind regards,

Axel

FlexSim 17.2.5
conveyordistance along conveyor
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

·
Arun Kr avatar image
2 Likes"
Arun Kr answered Axel Kohonen commented

Hi Axel Kohonen,

You have to look at the conveyor points node in the variables node of the conveyor.

In the conveyor points node, access the distancealong node value like this.

double  Distance = model().find("Conveyor1>variables/conveyorPoints/2/distAlong").value;

Regards,

Arun KR

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

Axel Kohonen avatar image Axel Kohonen commented ·

Thank you @Arun KR

This works nicely!

Axel

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.