question

Lucas D4 avatar image
1 Like"
Lucas D4 asked Jon Abbott commented

It has a command to change taskExecuter navigator value?

Does anyone know if there is a command to change traveler navigator type?

I'm creating an object with a "Create Object" activity. It is created with Navigation = DefaultNavigator.

I would like to create a custom code that changes it from DefaultNavigator to AStarNavigator.


I couldn't find any command on help.

FlexSim 20.2.0
flexsim 20.2.0navigationcommand
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 Jon Abbott commented

Simple user command code would be:

//User Command setNavigator
Object te=param(1);
Object navigator=param(2);
if (objectexists(navigator)) {
    clearcontents(node(">variables/navigator",te));
    function_s(navigator, "addMember", te);
}

which could then be called with

setNavigator(Model.find("TaskExecuter1"),Model.find("AStarNavigator"));
· 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.

Jon Abbott avatar image Jon Abbott commented ·

I just ran into this issue as well. I noticed that if a task executer is defined in the flowitem bin with its navigator type set to AStarNavigator, created objects of the task executer don't inherit this property and just use DefaultNavigator instead. I think it would be preferable and very useful if this property were inherited like the rest of the object properties. I'll forward this suggestion to [email protected] as well. Thanks!

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.