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 04-26-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default 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  
Old 04-26-2011
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

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
  #3  
Old 04-26-2011
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

I think to instantiate from the library you'll need 'createinstance()'.
  #4  
Old 04-26-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default

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
Attached Thumbnails
Click image for larger version
Name:	commands.JPG
Views:	130
Size:	61.4 KB
ID:	1367  
  #5  
Old 04-26-2011
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

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  
Old 04-27-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default

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


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.