setitemtype not working?

setitemtype not working?

bryan_suharik
Not applicable
20 Views
3 Replies
Message 1 of 4

setitemtype not working?

bryan_suharik
Not applicable

[ FlexSim 16.0.6 ]

Hello, I can't seem to change the itemtype of the source upon creation of the source through code.

AS you can see, the source is created. I've already assigned the arrival interval based on a global table that works well, but upon creation it defaults to item type = 1. I have a processor down stream that varies the process time depending on the item type, but i can't build the source with the item type i need.

How do you code in an item type assignment for a Source that's been created through code?

THANKS!

createinstance(node("/Source",library),model()); treenode Pump=last(model()); setloc(Pump,-50,cr,0); string InterArrivalTime1 = "treenode current =ownerobject(c); return gettablenum(\"GlobalTable20\",1,1);"; setvarstr(Pump,"interarrivaltime",InterArrivalTime1); setitemtype(Pump,3);

This is the source that's created...as you can see, the item type remains 1.00 by default and doesn't change to 3 as i'd like in the setitemtype.

0 Likes
Accepted solutions (1)
21 Views
3 Replies
Replies (3)
Message 2 of 4

bryan_suharik
Not applicable

Sorry, forgot to attach image. Thanks

4196-setitemtype.png

0 Likes
Message 3 of 4

arunTTT2P
Explorer
Explorer
Accepted solution

Hi Bryan,

You need to use

setvarnum(Source,"interarrivaltype",itemtypenumber);

Basically, you need to access and change the node info responsible for your requirement.

4197-treenodeview.png

Regards,

Arun KR

Message 4 of 4

bryan_suharik
Not applicable

Yep, that was it. I knew i was close! The node is actually "interarrivalitemtype", but close enough as i got it! Thanks!

0 Likes