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
|
||||
|
||||
How to hide VisualTool object?
I would like to hide VisualTool object dynamically. Is there any way to do it?
I found that the Show 3D Shape under General tab of Properties Window won't work for VisualTool, although it works for other objects such as Queue, Processor ect. The command switch_hideshape() won't work for VisualTool since basically it does the same thing as the Show 3D Shape under General Tab. Thanks. Alan |
#2
|
||||
|
||||
Alan,
It should work just fine, unless I am not understanding your problem. I have attached a small model that hides/shows the 3-D shape every 5 seconds; it was done with a message loop that sends a new message every 5 seconds. If this is not what you are talking about, please help clarify the issue so we can help. Or, you could attach your model to a reply message and we can look at your model and see if we can't figure out whats going on. Thanks, Paul Toone Flexsim Support |
The Following User Says Thank You to Paul Toone For This Useful Post: | ||
arunkrmahadeva (04-07-2014) |
#3
|
||||
|
||||
Paul,
Thanks for your answer. When the visual tool uses imported shape, the switch_hideshape() won't work. Sorry I forgot mentioning that in the above post. Please see the attached model. Is it a intended behavior in Flexsim? Any solution? Thanks, Alan |
#4
|
||||
|
||||
I've been working on this the past couple days and I can't find a way to hide a visual tool when it is an imported shape. I've checked with our developers and they have said there is just no way to hide a visual tool when it has an imported shape as it's object. Sorry I don't have a better answer for you.
I will continue to work on this and inform you if I find a solution to your question. Thanks for you patience. Last edited by Paul Toone; 09-14-2007 at 10:34 PM. |
#6
|
||||
|
||||
Alan,
I have found out a little bit more information on the question you asked. The VisualTool manages the "hideshape" switch internally. In other words, it executes switch_hideshape() in its internal OnDraw event to switch the display of its 3D shape on/off based on the current "Minimum Magnification" and "Maximum Distance" values assigned to the VisualTool. Therefore it doesn't do any good to execute switch_hideshape() as a modeler because the object is continually switching it's shape the way it wants it. Here are a few alternative ways I came up with to dynamically hide a Visual Tool's "Imported Shape" using code. 1. USE A DIFFERENT OBJECT: You can use an object besides the VisualTool to display the imported shape, and then switch_hideshape() can be used to hide the 3D shape. Ex - Use a processor insetead of a visual tool. 2. SET MAXIMUM DISTANCE TO ZERO: setvarnum(object, "viewdistance", 0); 3. RENAMING THE 3D FILE REFERENCE: setnodestr(shape(object), " _ "); buildall(); 4. SET THE SHAPE INDEX TO ZERO: setnodenum(shapeindex(object), 0); setnodename(shape(object)," _ "); I hope this helps out a little bit more to answer why the switch_hideshape command didn't work for you on the visual tool. Thanks, Paul Toone |
#7
|
||||
|
||||
Thank you Paul. Using the method setting maximum distance to zero works well. I really appreciate your help. I suggest we put this into Flexsim Tips. :-)
Alan |