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 08-02-2010
Congshi Wang Congshi Wang is offline
Student
 
Join Date: May 2010
Location: Germany
Posts: 58
Downloads: 2
Uploads: 0
Thanks: 48
Thanked 0 Times in 0 Posts
Rep Power: 124
Congshi Wang is on a distinguished road
Default Variable for Flexsim Object

Hello,

does anyone know if I can set a variable for a Flexsim object like for a number?

For example:

Object Processor1 = last(model) like int NumberCustomer = 50

I want to connect these objects by calling the object variable so I don't have to open the node everytime:

I want to do it this way: contextdragconnection(Processor1, Processor2, "A")

and not this way: contextdragconnextion(node("/Processor1",model()),node("/Processor1",model()),"A")

Thanks a lot!
  #2  
Old 08-02-2010
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

local variable:

treenode Processor1 = node("/Processor1",model());
treenode lastobject = last(model());

or make a global variable:

main menu option Tools > Global Variables. Add a "Tree Node" type global variable.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Congshi Wang (08-02-2010)
  #3  
Old 08-02-2010
Congshi Wang Congshi Wang is offline
Student
 
Join Date: May 2010
Location: Germany
Posts: 58
Downloads: 2
Uploads: 0
Thanks: 48
Thanked 0 Times in 0 Posts
Rep Power: 124
Congshi Wang is on a distinguished road
Default

Hello Phil,

can I create a global variable directly in the Flexscript code?

Thanks!
  #4  
Old 08-03-2010
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

It is possible, but you shouldn't do it unless you know exactly what you are doing. There is probably a much better way to do whatever you are doing rather than dynamically adding global variables via Flexscript code.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Congshi Wang (08-04-2010)


Thread Thread Starter Forum Replies Last Post
Why the object’s color can not show in Flexsim 5.02? Frans Zeng Q&A 6 07-26-2010 02:41 PM
Storing a C++ class pointer in a flexsim object Steven Hamoen Q&A 2 04-15-2010 09:19 AM
Global variable as experiment variable Matthias Hofmann Q&A 3 09-08-2009 09:42 AM
COM Object for Controlling Flexsim Anthony Johnson User Development 6 02-25-2009 11:43 AM
Flexsim Please Help - 99 Variable Limit Joe Allen Q&A 13 11-19-2008 12:03 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.