ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 08-31-2012
naren nataraj naren nataraj is offline
Flexsim User
 
Join Date: Aug 2011
Location: INDIA
Posts: 28
Downloads: 20
Uploads: 0
Thanks: 36
Thanked 1 Time in 1 Post
Rep Power: 108
naren nataraj is on a distinguished road
Default 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  
Old 08-31-2012
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.