"rotate" is a user command,how can i use it in DLL
"rotate" is a user command,how can i use it in DLL
User commands are stored in the tree under MODEL:/Tools/UserCommands/rotate. Their code is stored in the first subnode which is usually called "code".
You can use the nodefunction command like you would normally to execute the user command, from the DLL:
treeonde rotateCommand = first(node("MODEL:/Tools/UserCommands/rotate")); double result = nodefunction(rotateCommand, robot, Rot, order_number, table_name1);
Note, however, that this makes your DLL non-reusable by another model, unless that model also happens to have the same user command.
You may want to consider implementing the rotate functionality in the DLL instead:
visible double rotate(FLEXSIMINTERFACE) { // ... }
and then linking the user command to the DLL function, as described in the Module SDK documentation:
Question for @anthony.johnson: does it matter whether you call nodefunction(x, ...) or x->evaluate(...) in this case?
Thank you for your reply, I can use user command in DLL. But I also want to know if “TASKTYPE_STARTANIMATION” can use in DLL?
Why don't you just try it? Basically this is just a macro so just look for it or try typing and intellisense will tell you if it exists or not.
Note that you can actually look inside the FlexSim headers from your Visual Studio project. If you #include "FlexsimDefs.h" it will eventually include allobjects.h which defines the TASK_... constants and more.
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved