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
|
|||
|
|||
Need A Script
Hello,
I'm looking to write a script that will scroll through X objects in the tree and disable "show connections." I know you can do this globally and locally through the GUI but I want to control X as I am building a very large model. Any help? I'm new to scrip writing. Also, how to execute the script? Thanks
__________________
"A bird is an instrument working according to mathematical law, which is within the capacity of man to reproduce." -Leonardo da Vinci, 1502 |
#2
|
|||
|
|||
put this in a script window:
Code:
forobjecttreeunder(model()) { if(switch_selected(a,-1)) { if(switch_hideconnectors(a,-1)) { switch_hideconnectors(a,0); } else { switch_hideconnectors(a,1); } } } |
The Following User Says Thank You to Alex Christensen For This Useful Post: | ||
Gavin Douglas (07-17-2008) |
#3
|
|||
|
|||
Script example
Also, you can manage groups of objects through the "Groups" option in the sidebar instead of manually selecting them each time. Bear in mind that Alex's code toggle's the connector setting so you probably don't want to mix those switched on with those that aren't.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Gavin Douglas (07-17-2008) |
#4
|
||||
|
||||
Gavin,
If you didn't already know, there is a button in the ortho view's side panel that already does what Alex's script does. It's at Edit Selected Objects | Switches | Toggle Ports. This option, however, will sync the toggles of the selected objects, whereas Alex's flips each one so they're not necessarily synchronized. You can use the Groups panel in conjunction with this option to get what you need. |
Thread | Thread Starter | Forum | Replies | Last Post |
InputBox in Flexsim script | AlanZhang | User Development | 1 | 04-08-2015 05:08 AM |
Dynamic script generation: Good Example with a User Command | Naresh Yamani | Tips and Tricks | 2 | 05-16-2008 06:54 PM |