ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Assigning a flexscript code in a node
Hi everyone,
I have a code and I have a particular node in the tree. I want the code to be copied on the node and executed. But I should not do it manually going to the tree & by pasting it . I want to use a code in sript window to paste the required code in the node. For example : I have this code and I need to paste this in a node of the tree without going to the node. treenodecurrent = ownerobject(c); treenode item = parnode(1); /***popup:ValuesByCase:hasitem=1:valuestr=Time*/ /**Values By Case*/ /** \nCase Function: */ int case_val = /***tag:ValueFunc*//**/getitemtype(item)/**/; switch (case_val) { /***tagex:data*//***/ default: return /** \nDefault Time: *//***tag:default*//**/1/**/; } return 0; Please suggest how to do it. Thanks in advance. Naren. |
#2
|
||||
|
||||
For now I see 2 solutions:
1. Put this in a node and copy this node onto the destination node (with createcopy) 2. Put this code in a string and set this string on the node (with setnodestr ) Then switch the node to flexscript (switch_flexscript) build it (buildnodeflexscript) and execute the node ( nodefunction) |
The Following User Says Thank You to Steven Hamoen For This Useful Post: | ||
Vadim Fooks (08-31-2012) |
Thread | Thread Starter | Forum | Replies | Last Post |
few questions: Node toggled s flexscript, C++, dll | Shahin Gelareh | Q&A | 4 | 04-23-2012 02:08 AM |
executing automaticly writte flexscript code | Congshi Wang | Q&A | 1 | 11-10-2010 05:38 PM |
How to change FlexScript node function | luis quinones | Tips and Tricks | 1 | 09-14-2010 03:50 AM |
How to load a *.t file into a node with commands/code? | Tom David | Q&A | 5 | 01-12-2009 11:31 AM |
Edit Value of Variable in Flexscript Node | Joe Allen | Q&A | 19 | 09-17-2008 05:39 PM |