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 02-04-2009
Anthony Timmiss Anthony Timmiss is offline
Flexsim User
 
Join Date: Aug 2007
Location: Sunderland - UK
Posts: 78
Downloads: 41
Uploads: 0
Thanks: 65
Thanked 45 Times in 28 Posts
Rep Power: 187
Anthony Timmiss will become famous soon enoughAnthony Timmiss will become famous soon enough
Default 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  
Old 02-04-2009
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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  
Old 02-04-2009
Dirk-Jan Dirk-Jan is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Utrecht, Netherlands
Posts: 43
Downloads: 35
Uploads: 0
Thanks: 11
Thanked 22 Times in 16 Posts
Rep Power: 170
Dirk-Jan will become famous soon enough
Default

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  
Old 02-04-2009
Dirk-Jan Dirk-Jan is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Utrecht, Netherlands
Posts: 43
Downloads: 35
Uploads: 0
Thanks: 11
Thanked 22 Times in 16 Posts
Rep Power: 170
Dirk-Jan will become famous soon enough
Default

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


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.