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 11-06-2012
wildcard wildcard is offline
Flexsim User
 
Join Date: Oct 2010
Location: Bingen on Rhine
Posts: 2
Downloads: 12
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
wildcard is on a distinguished road
Default put objects in a group automatically by code

I have the following question. Maybe anyone has an idea. (sorry for my bad english).

I have to greate a lot of tables on a resettrigger. And I will put all this tables in a group by code. Later in the simulation I have to delete this group.

So, my idea is, fist I greate a group and everytime I greate a table I will put this table in the group. Please look the following code:

//great a group
treenode t_group = node("/Tools/Groups",model());
nodeinsertinto(t_group);
setnodename(last(t_group), "Tables");
treenode t_tables = node("/Tools/Groups/Tables",model());

//reference to to tabel nr. 1
treenode t_table = node("/Tools/GlobalTables/table_nr_1",model());

//insert table nr.1 in group
nodeinsertinto(t_tables);
nodeadddata(last(t_tables), DATATYPE_NUMBER);
setnodenum(last(t_tables), tonum(t_table)); // here is the problem! not the right code I thing!

My question: What is wrong with the last codeline?

Thanks for your help!!
  #2  
Old 11-06-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

If you want the Groups to conform to the Group structure you'll need to create couplings. I'll post a library with some commands that makes this easy in a few minutes.

Last edited by Jason Lightfoot; 11-06-2012 at 04:09 PM.
  #3  
Old 11-06-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

This library installs some user commands. You get compile errors when it loads - that's a quirk you don't need to worry about.
Attached Files
File Type: zip GroupUtils.zip (1.2 KB, 87 views)
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post:
williamjpinto (11-07-2012)
  #4  
Old 11-07-2012
wildcard wildcard is offline
Flexsim User
 
Join Date: Oct 2010
Location: Bingen on Rhine
Posts: 2
Downloads: 12
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
wildcard is on a distinguished road
Default

very helpful in Flexsim R 6.0.2 - Thanks


Thread Thread Starter Forum Replies Last Post
automatically connecting network nodes Albert Munoz Q&A 1 05-16-2012 12:19 AM
Group Capacity Jason Lightfoot User Development 7 03-24-2011 07:21 PM
Stopping automatically the simulation after set a Timetable or User Event Gleny Rodriguez Q&A 4 03-16-2010 01:04 AM
New LinkedIn Group Bill Nordgren Product Announcements 0 01-21-2010 11:50 AM
Automatically generated global tables Sebastian Dransfeld Gripes and Goodies 1 09-01-2008 12:44 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.