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 03-16-2013
Christian Norregaard Christian Norregaard is offline
Flexsim User
 
Join Date: Oct 2011
Posts: 59
Downloads: 13
Uploads: 0
Thanks: 33
Thanked 14 Times in 9 Posts
Rep Power: 115
Christian Norregaard will become famous soon enough
Default Adding Flexsim custom shortcut keys

Hey all.

Has anyone dabbled in creating custom shortcut keys?

What I am looking for is a way to use a keyboard shortcut to execute a bit of Flexscript code. Can this be done, and if not, can it be added to the development list?

Have fun simulating everyone.

Best regards
Christian
  #2  
Old 03-18-2013
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

You can use a usercommand to add custom shortcut keys. It could look like this:

Code:
if(lastkeydown())//key pressed?
{
    switch (lastkeydown())//which key?
    {
        case 113:    //p.e. F2-Key
                         //your code
                         break;
        case 114:    //p.e. F3-Key
                         //your code
                         break;
    }
}
You have to add this usercommand into the trigger OnKeyDown in persp-view.

Attention: Flexsim has a lot of keyboard shortcuts. This could collide with your own shortcut keys.
The Following 4 Users Say Thank You to Carsten Seehafer For This Useful Post:
Jörg Vogel (03-18-2013)
  #3  
Old 03-18-2013
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

P.S.: This is a link of shortcut keys but it's not up-to-date (Version 5)

http://www.flexsim.com/community/for...ight=shortcuts
  #4  
Old 05-16-2013
KvThiel KvThiel is offline
Flexsim User
 
Join Date: Jan 2013
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 89
KvThiel is on a distinguished road
Default

Is it possible to upload an example with this shortkey command in it?

I'm strugling to get the OnKeyDown code into a perspective view to zoom-in with a key (F2).

Kind regards,

Koen van Thiel
  #5  
Old 05-23-2013
KvThiel KvThiel is offline
Flexsim User
 
Join Date: Jan 2013
Posts: 12
Downloads: 3
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 89
KvThiel is on a distinguished road
Default CharCode instead of KeyCode possible ?

Is it possible to work with charCode instead of keyCode? I want to create a zoom function, when I press and hold a button it has to zoom in.

Does anybody know what the code is to do this?

for keyCode I already have:

if(iskeydown(102)) //Numpad 6
if (eq(lastkeydown(),102)) //Numpad 6

kind regards,

Koen van Thiel
  #6  
Old 05-23-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

You can zoom with pressing both mousebuttons and moving mouse.
__________________
Hemmi
  #7  
Old 05-23-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Use pd() to print the lastkeydown() to the output console. Then you can check for that specific key by its keycode.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Jörg Vogel (12-11-2013)
  #8  
Old 12-10-2013
pcloutier pcloutier is offline
Patrick Cloutier
 
Join Date: Mar 2009
Location: Montreal
Posts: 9
Downloads: 9
Uploads: 0
Thanks: 3
Thanked 7 Times in 2 Posts
Rep Power: 0
pcloutier is on a distinguished road
Default Define Views and access them from dashboard

I've been trying to do something similar by creating Views and selecting them with buttons in a custom dashboard. For example: Close-up, Right side, Left side.

But I can't find a Command that would allow to select a predefined View. Is there one? Any other way to do this?

Thanks
  #9  
Old 12-11-2013
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default gui button to open a View

The code I am using in my Model Control GUI to open View 1.

On Press:

// SET THE VIEW TO THE CAPTURED VIEW (DON'T FORGET THAT THE GUI NEEDS Apalettewindow ATTRIBUTE)
// STOP THE FLY PATH
flystop();
// POINTER TO CURRENT VIEW
treenode curview = NULL;
curview = node("/Tools/PerspViews/1",model());
// SET THE VIEW
executefsnode(curview,curview,0,0,0);
// SCREENREFESH
repaintall();

As written in the comments it is important, that the GUI needs a “palettwindow” attribute.

This is just a node in the tree like viewfocus, spatialx, OnClose, etc.
Just add a node in the tree and call it “palettwindow”.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
The Following 4 Users Say Thank You to Tom David For This Useful Post:
Sebastian Hemmann (12-11-2013)
  #10  
Old 12-11-2013
pcloutier pcloutier is offline
Patrick Cloutier
 
Join Date: Mar 2009
Location: Montreal
Posts: 9
Downloads: 9
Uploads: 0
Thanks: 3
Thanked 7 Times in 2 Posts
Rep Power: 0
pcloutier is on a distinguished road
Default

I should have indicated that I didn't create a GUI the old fashioned way. I created a Dashboard (new with version 7).

I put the exact above code in the OnPress code of my button on my dashboard (except I changed the 1 for the name of my view).
I've inserted a node called "palettwindow" into my dashboard node.
Nothing happens when I press on the button.
Any ideas?
  #11  
Old 12-11-2013
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

The code in Tools/PerspViews sets the view on the active document window. When you are clicking in your Dashboard, the dashboard window is the active document window.
The Following User Says Thank You to Phil BoBo For This Useful Post:
Tom David (12-12-2013)
  #12  
Old 12-12-2013
pcloutier pcloutier is offline
Patrick Cloutier
 
Join Date: Mar 2009
Location: Montreal
Posts: 9
Downloads: 9
Uploads: 0
Thanks: 3
Thanked 7 Times in 2 Posts
Rep Power: 0
pcloutier is on a distinguished road
Default

Si is there another way to do it? (selecting predefined views through buttons in a dashboard)


Thread Thread Starter Forum Replies Last Post
Adding some Collision Spheres Sebastian Hemmann Q&A 3 02-14-2011 07:30 AM
Problem with redefined keyboard keys Danny Pavan Q&A 2 06-21-2010 09:26 AM
Adding a Line Trend in the GUI JMEngelhart Tips and Tricks 1 03-08-2010 04:04 AM
Excel Short Cut Keys Brandon Peterson Tips and Tricks 1 09-30-2009 08:04 AM
Change Flexsim keyboard shortcut AlanZhang Q&A 1 12-03-2008 02:41 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.