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
|
|||
|
|||
Set maxcontent of Forklift
Hi
Ia m trying to change the capacity of the forklift object. I have the following code in the onLoad trigger of the forklift but the capacity is not changing. The code is definitely being executed so there must be something wrong in the code. Please help. /**Custom Code*/ treenodeitem = parnode(1); treenode current = ownerobject(c); treenode station = parnode(2); if (getitemtype(item) ==999) { setnodenum(node(">variables/maxcontent"),3); pt("code to set capacity at 3 executed"); pr(); } else { setnodenum(node(">variables/maxcontent"),1); pt("code to set capacity at 1 executed"); pr(); } |
#2
|
|||
|
|||
Hi,
Change your setnodenum like this From: setnodenum(node(">variables/maxcontent"),3); To: setnodenum(node(">variables/maxcontent",current),3); You can also use setvarnum like this: setvarnum(current,"maxcontent",3); Lars-Olof |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Anthony Timmiss (02-04-2009) |
#3
|
|||
|
|||
Hi,
You forgot the starting node in your node command: node(">variables/maxcontent") should be: node(">variables/maxcontent",current) But even easier to use setvarnum. Example: setvarnum(current,"maxcontent",3) Regards, DJ |
The Following User Says Thank You to Dirk-Jan For This Useful Post: | ||
Anthony Timmiss (02-04-2009) |
#4
|
|||
|
|||
Lars you was a second earlier :-)
|
The Following User Says Thank You to Dirk-Jan For This Useful Post: | ||
Anthony Timmiss (02-04-2009) |
Thread | Thread Starter | Forum | Replies | Last Post |
Forklift with custom fork 3D object. | Anthony Johnson | Tips and Tricks | 0 | 07-09-2008 12:22 PM |