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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
This library installs some user commands. You get compile errors when it loads - that's a quirk you don't need to worry about.
|
The Following 3 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
williamjpinto (11-07-2012) |
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 |