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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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) |
#7
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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.
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
|
||||
|
||||
Cliff,
Thanks for the clear explanation. But my question still stands, what to do about it? Any suggestions? Steven |
#11
|
||||
|
||||
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); 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 |