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 > Tips and Tricks
Downloads

Tips and Tricks Share helpful modeling ideas

  #1  
Old 09-18-2007
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 How to dynamically show/hide the imported 3D shape assigned to a VisualTool

First of all, you need to understand that the VisualTool manages the "hideshape" switch internally. In other words, it calls the switch_hideshape() command in its internal OnPreDraw event to switch the display of its 3D shape on/off based on the current "Minimum Magnification" and "Maximum Distance" values chosen by the modeler for the VisualTool. Therefore it doesn't do any good to execute switch_hideshape() as a modeler because the object is continually switching it back to how it wants it.

Here are a few alternative ways to dynamically hide a VisualTool's "Imported Shape" using code.

1. USE A DIFFERENT OBJECT:
The easiest thing to do is use an object besides the VisualTool, then the switch_hideshape() command will be effective in hiding the 3D shape of the object. Using a BasicFR object is suggested because it has very little overhead, doesn't have any shape factors (i.e. offsets), and has a good default size of 1 X 1 X 1.

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)," _ ");

Four options are listed for educational purposes, but it is suggested that you use option 1 or 2.

Last edited by Cliff King; 09-18-2007 at 04:15 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.