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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #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: 103
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.
Reply With Quote
  #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: 680
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)
Reply With Quote
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Vadim Fooks (08-31-2012)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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. The time now is 05:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.