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-28-2008
Martijn van Oostenbrugge's Avatar
Martijn van Oostenbrugge Martijn van Oostenbrugge is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 71
Downloads: 12
Uploads: 0
Thanks: 44
Thanked 44 Times in 24 Posts
Rep Power: 268
Martijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to all
Default Flowitem Bin and Media Files

Yes yes again a trainee noted me on the delete command in the flowitem bin and the media files. He added a reasonably amount of object shapes to the media files and set his model to these media files (it's starts from number 53 and higher if you add those). Later he realized he wanted to change f.i. number 54 (name and shape). You could just delete it (which he did) and add a new one to the media files, but then you have to change your model completely. Of course you could also leave it and add a new one, which is much quicker. But anyway the delete but is just a bit tricky (also add the flowitem bin) and confusing for a standard user.

Also if you delete a shape in the media files, the numbers are only updated after you reloaded the media files manually.

Martijn
The Following 2 Users Say Thank You to Martijn van Oostenbrugge For This Useful Post:
Jörg Vogel (08-28-2008)
  #2  
Old 08-28-2008
Dustin Derrick Dustin Derrick is offline
FlexSim Consultant
 
Join Date: Jul 2007
Posts: 17
Downloads: 23
Uploads: 0
Thanks: 20
Thanked 35 Times in 7 Posts
Rep Power: 223
Dustin Derrick is a jewel in the roughDustin Derrick is a jewel in the roughDustin Derrick is a jewel in the roughDustin Derrick is a jewel in the rough
Default

The best way to avoid any problems with loading media is through the use of a user event and global variable. By simply creating a global variable (of type Integer) and then setting this global variable in a user event using:

yourglobalvar = getshapeindex("pathtoyourmediafile");

you can eliminate future hassle as you change the model or even change computers. Then simply change the 3D shape using your global variable as your reference.
The Following 4 Users Say Thank You to Dustin Derrick For This Useful Post:
Phil BoBo (08-28-2008)
  #3  
Old 08-28-2008
Martijn van Oostenbrugge's Avatar
Martijn van Oostenbrugge Martijn van Oostenbrugge is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Posts: 71
Downloads: 12
Uploads: 0
Thanks: 44
Thanked 44 Times in 24 Posts
Rep Power: 268
Martijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to allMartijn van Oostenbrugge is a name known to all
Default

Thanks Dustin, but it's still quite a hassle for simple users who just want to use as many pick lists as possible. It would be nice to be able to change an object shape even after you've already loaded it, or even a rank up / rank down button at this media files gui.

Martijn
  #4  
Old 08-28-2008
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

A "simple user" doesn't need to mess with the Media Files GUI at all. They can just use getshapeindex("filepath") wherever any picklist requires a number of the media file to change shape.
  #5  
Old 08-29-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Sorry Phil, but your answer is a bit blunt.
A simple user will look at the triggers and one of the options there is:
*****
Change 3D Shape
Object: item
Shape Index Number: 1

Index values for 3D shapes can be found through the Tools>Media Files menu, but keep in mind that index values can change when new media is loaded, so it is better to define the index with a global variable that gets set during reset using the getshapeindex() command.
*****

So where does a simple user look?
Right! in the media files under tools.
So what Martijn wanted to say is that there are definetely some improvements possible in that gui, that it is not intuitive, and I agree with him.
In the end using a number is a lot easier that having to cope with large media file paths that are always different on different computers, that sometimes need or do not need double slashes etc.

So I will look at the development list and see if there is an issue there otherwise I'll add one.

Steven
The Following 2 Users Say Thank You to Steven Hamoen For This Useful Post:
Phil BoBo (08-29-2008)
  #6  
Old 08-29-2008
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

Yep. I guess you are right. The picklist even tells a simple user how to do it Dustin's way.
  #7  
Old 08-29-2008
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Barring a complete revamp of the way that media is loaded in Flexsim, I don't see any comprehensive way of "re-ordering" the numbers that are assigned to media files in Flexsim. When Flexsim reloads media, it searches the project tree, and media are given numbers based on the order that they are found in the tree. The media files GUI just piggy-backs on that mechanism by adding quasy-objects into the model tree that have a shape defined on them. You may be able to reorder the objects within the media files part, but that only gives you a certain range of reordering, and even then, if the next version of Flexsim has a new object with a new shape, then all of those media files are going to be offset. I think the best way to do it still is to use getshapeindex, either using a global variable, or by accessing it directly in the picklist. Maybe the picklist needs to have "getshapeindex(...)" as the default option, and then when you select the text, you get a drop down of all the current media paths that are loaded.
  #8  
Old 09-01-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Anthony,

If this is the case, then it might be a good idea to remove this gui completely or put it further away, because now if you open it, it promises things that actually can't be done or gives you a way to handle the shapes and bitmaps that is actually not the right way to do it.

Anybody a different suggestion or opinion?

Steven
  #9  
Old 09-01-2008
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default

Here's a list of some things users need with regards to media content, and we should continually strive to make it as easy and straight forward as possible.
  1. Import media to be assigned to an object in your model (e.g. shape, imageobject, imagebase, picture).
  2. Import media that is not assigned directly to an object in your model, but which you want to reference in a trigger to change an object's media assignment.
  3. Import media that you want to reference in the Custom Draw Code field of an object with the drawobject() command, but you do not want the media to be assigned directly to the object.
Currently #1 is fairly simple and can be achieved with the Properties window. In v4.5, the Properties and Parameters windows are going to merge which should simplify this even more.

In order to accomplish #2 and #3, Flexsim implemented the Tools>Media Files window, but there are a couple problems with this approach. First, it gives you the impression that you can use the rank number listed to the left of the media path/name; and second, the media is not packaged or even associated in any way with the object you may want to use it on. The second point is more of an issue when trying to create a userlibrary object.
The Following User Says Thank You to Cliff King For This Useful Post:
Brandon Peterson (10-01-2009)
  #10  
Old 09-04-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Cliff,

Thanks for the clear explanation.

But my question still stands, what to do about it? Any suggestions?

Steven
  #11  
Old 09-04-2008
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default

Here's some code I've successfully used in an OnReset userevent to load a specific 3D media file that is not listed in the "shape" attribute of any object in the model:
Code:
string curshapestr = "libraries\\media\\shapes\\woodchair.wrl";
int curshapeindex = getshapeindex(curshapestr);
if(curshapeindex == 0)
{
loadthreedobject(curshapestr, curshapestr);
}
curshapeindex = getshapeindex(curshapestr);
setnodenum(var(current, VAR_CurShapeIndex), curshapeindex);
I write the shapeindex of the loaded file to an object's variable for the purposes of referencing it in some OnDraw code of the object.

The problem is that if the media is ever refreshed in the model, I loose the reference to the shapeindex, and it requires the user to hit the Reset button again for the shapeindex to be restored. As you probably know, when media is refreshed, it only considers the strings found in the shape attributes of objects throughout the library and model for loading.

So that the user could see the shape upon first opening a model, I tried using an OnLoad attribute on the object with the above code. Although the OnLoad successfully fires when the model is opened, the on load event happens before the loading of media, so my index gets wiped clean after being loaded.

One other point about the above code is that it is much much faster than using autoloadmedia() because it does not need to traverse the entire tree and reload all the media that has already been loaded. We need to implement this strategy in our media open dialog boxes throughout Flexsim to reduce the delay when opening media files...
The Following User Says Thank You to Cliff King For This Useful Post:
Tom David (09-04-2008)


Thread Thread Starter Forum Replies Last Post
Things I like about v4.3 (autocompletion, billboards, shortcuts, relative media paths, code editor) Tom David Gripes and Goodies 1 03-28-2008 02:34 AM
My gripes and improvement suggestions for v4.30 (Ctrl+C/V in tables, media path updater) Tom David Gripes and Goodies 2 03-18-2008 08:29 PM
Customizing Flowitem Attributes - a quest for the flowitem with the fewest attributes Cliff King Tips and Tricks 0 11-22-2007 12:22 PM
Creating fsm-Files Ralfi Q&A 4 10-16-2007 06:07 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.