question

Wang Z2 avatar image
0 Likes"
Wang Z2 asked Joerg Vogel edited

how to use "createcopy" command in AGV module

In my simple model,I create StraightPath with code,then I try to copy the Path in createcopy command.but it failed,I don't know why.

The code show as below,The model is createcopy.fsm

treenode path1 = createinstance(node("/AGV/StraightPath",library()),model());
setsize(path1,Bay*0.54/3+0.5,1,1);
setloc(path1,0,0.5,0.5);

Object obj=createcopy(path1,model(),1,0,1,0);
setloc(obj,0,0.5,1);
FlexSim 18.2.3
agv pathcreatecopyfunction_sfinalizespatialchanges
createcopy.fsm (26.7 KiB)
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

The objects of AGV belong to an module. Modules behave different to standard objects. You can copy objects or resize, but you need additional commands to finalize the copy process. Please find answers yourself where the code uses command lines starting with “function_s”.

0 Likes 0 ·
Wang Z2 avatar image Wang Z2 Joerg Vogel commented ·

Thanks for your advice.

I browsed all the questions about "function_s" and searched for helps raleted in the User manual.but I didn't find the answer I needed. I still don't know how to use "functions_s" to copy paths.

Can you tell me how to write the code ? Or Where should I go to learn related content?

0 Likes 0 ·
Xu Chunqi avatar image Xu Chunqi Wang Z2 commented ·

You can add a sentence at the end of the code : function_s(obj, "finalizeSpatialChanges");

Besides, we are the general agent in china , you can come to our company to learn the code.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

You find the answer in the question “How to create and join AGV paths in flexscript”!

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.