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
|
|||
|
|||
auto pulling objects from library through gui
I am using Flexsim 4.52, want to create model dynamically. I have made gui on which there is create button, on pressing create button it should place the library objects and do the interconnection dynamically for example if want to create a warehouse and user say num of racks are 10, model will automatically pull 10 racks from the library and do the interconnection as per user requirement on custom gui ( Dashboard).
I tried using this in create button ( On press ) script as following treenode new = library\Rack; setloc(new, 50,50,0); the above script is giving error, have gone through manual thoroughly but could not resolve it. Looking for kind help. Thanks & Regards Shashank Trivedi |
#2
|
||||
|
||||
Shashank,
the commands you would want to look up are: - createcopy() to create objects in the model - contextdragconnection() to connect these objects, once they are created. In your code you only created a pointer to a library object and tried to set its location, but you missed to create the object in the model. BTW, to create an appropriate pointer you would need the node() command. Hope that helps Good Luck! Ralf aka Ralle Flexsim |
#4
|
|||
|
|||
Thanks for prompt reply.
first question, i don't have command help whenever i click on the command under the menu help menu, something opens up in the browser as per attachment with nothing on it. secondly i tried above mentioned, still could n't resolve. i tried as per createcopy(node(library:\Source,new)); //node(library:\Source, new); //new = createinstance(new,library:\Source); setloc(new, 50,50,0); would it be possible to have some sample script, kindly help. Thanks&Regards Shashank Trivedi |
#5
|
||||
|
||||
Jason was right, use createinstance to create objects from the standard library within the model. Here's an example:
createinstance(node("/Source",library),model()); treenode lastobject=last(model()); setloc(lastobject,50,50,0); Hope that helps. Ralf aka ralle Flexsim |
The Following 2 Users Say Thank You to RalfGruber For This Useful Post: | ||
Stefan Trabut (05-04-2011) |
#6
|
|||
|
|||
Thanks alot,
Still i would say user manual is too much basic and command help does n't work at my license, clueless where to get complete documentation where description about each and every command is given. If somebdy can throw light on this, would be reat help to me, since it is practically impossible to post each and every query on forum . Regards Shashank Trivedi |
Tags |
dynamic model creation |
Thread | Thread Starter | Forum | Replies | Last Post |
Which class is the flexsim CT library objects? | syseo | Container Terminal (CT) Library | 0 | 02-10-2011 03:44 AM |
How to save several objects as one object and put it into custom library | Chunyan Liang | Q&A | 1 | 10-15-2010 03:25 AM |
How to add objects to user library in V 5 | Sebastian Hemmann | Q&A | 4 | 10-06-2010 04:43 AM |
No trigger templates for Fluid Library objects | David Chan | Q&A | 3 | 05-21-2010 09:29 AM |
Pulling multiple objects | Roland Tainton | Q&A | 0 | 03-24-2009 06:05 AM |