question

Jay K9 avatar image
0 Likes"
Jay K9 asked Jeanette F commented

How to put control point at equal distance on AGV network with flexscript?

I want to put control point every 5m on the AGV network without manually dragging 100's of them on the network. Is there a way I could do this using flexscript?

FlexSim 23.0.8
flexscriptagvnetworkcontrolpoint
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Jay K9, was Kavika F'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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Kavika F avatar image
0 Likes"
Kavika F answered

Hey @Jay K9, you could check out this post on a Kiva System Demo Model for reference. In the model, they have a User Command called "CreatePathGrid" which makes the AGV Paths and Control Point.

You'll see these commands in the code, but I'll point them out here. You'll want to programatically create ControlPoints using the Object.create() command.

Object cp = Object.create("AGV::ControlPoint");

Then you can set properties - like location - for that cp. If you define an x and y in a grid, you could do something like this:

cp.setProperty("Location", Vec3(x, y, 0));

Finally, once you've made all those Control Points, you'll want to call "refreshAllPathLinks" on one of the paths in your model. If you made a path like this:

Object path = Object.create("AGV::StraightPath");

You can call this at the end of your script:

function_s(path, "refreshAllPathLinks");

Hope this helps.

5 |100000

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

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.