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 09-07-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Question 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  
Old 09-07-2007
Paul Toone's Avatar
Paul Toone Paul Toone is offline
Flexsim Technical Support
 
Join Date: Jul 2007
Posts: 13
Downloads: 59
Uploads: 31
Thanks: 0
Thanked 7 Times in 4 Posts
Rep Power: 160
Paul Toone is on a distinguished road
Default

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
Attached Files
File Type: zip switch_hide.zip (37.5 KB, 310 views)
The Following User Says Thank You to Paul Toone For This Useful Post:
arunkrmahadeva (04-07-2014)
  #3  
Old 09-10-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

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
Attached Files
File Type: zip switch_hide_importedshape.zip (38.7 KB, 305 views)
  #4  
Old 09-11-2007
Paul Toone's Avatar
Paul Toone Paul Toone is offline
Flexsim Technical Support
 
Join Date: Jul 2007
Posts: 13
Downloads: 59
Uploads: 31
Thanks: 0
Thanked 7 Times in 4 Posts
Rep Power: 160
Paul Toone is on a distinguished road
Default

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.
  #5  
Old 09-11-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

Thanks, Paul. At least I know I should not try to find an answer in the document any more.

Alan
  #6  
Old 09-17-2007
Paul Toone's Avatar
Paul Toone Paul Toone is offline
Flexsim Technical Support
 
Join Date: Jul 2007
Posts: 13
Downloads: 59
Uploads: 31
Thanks: 0
Thanked 7 Times in 4 Posts
Rep Power: 160
Paul Toone is on a distinguished road
Default

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  
Old 09-18-2007
AlanZhang's Avatar
AlanZhang AlanZhang is offline
Flexsim Super Moderator
 
Join Date: Aug 2007
Location: CA
Posts: 289
Downloads: 64
Uploads: 0
Thanks: 88
Thanked 91 Times in 47 Posts
Rep Power: 225
AlanZhang is a jewel in the roughAlanZhang is a jewel in the roughAlanZhang is a jewel in the rough
Default

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



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.