Hot keys of Moi3D

Next
 From:  motorsep
204.1 
Where can I find list of hot keys available in Moi3D ?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
204.2 In reply to 204.1 
Here are the defaults:

F1 Open help document.
Ctrl+A Select all
Ctrl+C Copy to clipboard
Ctrl+N New
Ctrl+O Open
Ctrl+S Save
Ctrl+V Paste from clipboard
Ctrl+X Cut to clipboard
Ctrl+Y Redo
Ctrl+Z Undo
Delete Delete

Also you can use Enter for "Done", and Escape for Cancel.

Keyboard shortcuts are defined in the moi.ini file, you can edit that file if you wish to create your own custom ones. See this message thread for more information: http://moi3d.com/forum/index.php?webtag=MOI&msg=35.1 Grendel has posted some .tif files there that gives a chart of the different command names that you can use inside the moi.ini file.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
204.3 
some useful shortcuts...


Hides all visible objects and shows all previously hidden objects:

A=script:var gd = moi.geometryDatabase; gd.deselectAll(); gd.hide(); gd.invertSelection(); gd.hide();



Extents the grid (array of lines in the viewport) twice:

B=script:moi.grid.Sections += moi.grid.Sections;



Switches snap angle between default 90° and 45° and vice-versa:

C=script:moi.drawingAids.straightSnapAngle = Math.abs( moi.drawingAids.straightSnapAngle - 135 );



Switches viewport between split and top(bottom)/front(back)/right(left) mode according to location mouse cursor (only adjustment Michael's script):

Space=script:if ( moi.ui.mainWindow.viewpanel.mode != 'split' ) { moi.ui.mainWindow.viewpanel.mode = 'split' } else { var viewport = moi.ui.getViewportUnderMouse(); if ( viewport ) { switch ( viewport.name ) { case 'Bottom': viewport.viewpanel.mode = 'top'; break; case 'Back': viewport.viewpanel.mode = 'front'; break; case 'Left': viewport.viewpanel.mode = 'right'; break; default: viewport.viewpanel.mode = viewport.name } } };



Reverses all relevant viewports (Top->Bottom and so on):

Ctrl+Space=script:var viewport = new Array( 'Top', 'Front', 'Right' ); for ( a in viewport ) { moi.ui.mainWindow.viewpanel.reverseView( viewport[a] ) };


Petr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
204.4 In reply to 204.3 
Tricky :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
204.5 
It is my first attempt at making a custom command...

1) Close down MoI
2) Unzip this file into the MoI's commands directory
3) Add a line D=CustomDistance to [Shortcut Keys] section in the moi.ini file,
   which you can find in C:\Documents and Settings\[your login name]\Application Data\Moi\moi.ini
4) Start up MoI and press the "d" key.... follow a prompt...



Petr

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
204.6 In reply to 204.5 

Works fine! Whith that no need to make a Ctrl + z for erase a line !
And good result as we can see the result also on the Botom bar :)

Is it normal than a line is drawn and disapears at the end? I suppose yes :)

Have you plan the same for Angle between 3 points in the space?

Ps What is the language used?

Pss For the translation : is not possible to use something yet existant in the ui folder?
Else now we are obliged to translate in the Command Folder too !
(not very practical:)

---
Pilou
Is beautiful that please without concept!
My Gallery

EDITED: 7 Feb 2007 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Richard (RUSIRIUS)
204.7 
Nice work Petr!
I haven't tied it but can you do formulas in the in the second and third point boxes?

For example: 23@<15 like in AutoCad
or X-Y-Z coordinates such as 2,5,0

Just curious :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
204.8 In reply to 204.6 
>>Is it normal than a line is drawn and disapears at the end? I suppose yes :)

Natch!..... hehe

>>Have you plan the same for Angle between 3 points in the space?

I guess there is no need for such commands as EvaluatePoint, Distance or Angle, actually. You can use Point, Line or Arc commands when you want to get particular information about the object. The Point, Distance, and Angle controls at the bottom of the screen provide a feedback. But when I want to learn a little more about scripting in MoI, I try to start with simple thing...

>>Ps What is the language used?

Scripting language? JScript

>>Pss For the translation : is not possible to use something yet existant in the ui folder?
>>Else now we are obliged to translate in the Command Folder too !
>>(not very practical:)

You are quite choosy.... hehe....


Petr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
204.9 In reply to 204.7 

Hi Richard,

Maybe, I should have mentioned that the script is for evaluating distance beetween two points, not for making object at all.

>>For example: 23@<15 like in AutoCad or X-Y-Z coordinates such as 2,5,0

I hope you know that you can type this in Point controls at the bottom of the screen when command requires you to enter a specific point.
e.g.
5,15
r5,15 or @5,15
5 (distance constraint)
<15 (angle constraint)
5<15 (absolute polar coordinate)
r5<15 (relative ones)

Petr

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
204.10 
This is very cool Petr. I can't believe you figured it all out with no documentation and without asking me any questions at all!

It was my hope that the command system would provide a way for other people to write new commands that worked the same as regular MoI commands (same UI, etc..), and you've done it here!

I've got to head out for a couple of hours, but when I get back I'll try to give you some feedback and what meager docs I can (the moi.idl file would be useful to you) to give you some additional information.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
204.11 In reply to 204.10 
Hi Petr - attached is the moi.idl file, which is the closest thing that passes for script documentation right now.

This file defines the "object model" of MoI - that is the properties and methods that are available to be called by a script.

Almost everything is listed here, except there are a few custom properties and methods on individual factories that are not listed here, but those are helpers that are pretty specific to a particular command.

This at least will give you the list of all available properties on the pointpicker for example, so you might find it useful.

The object model hasn't been frozen yet - by that I mean I can't guarantee to you that it won't change. But most of the changes at this point are for adding new things, it is not too likely that existing stuff is going to change too much.

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Richard (RUSIRIUS)
204.12 In reply to 204.9 
Well Petr you learn something new every day :)

No i didn't know that the functionality that I was asking about is already in Moi.

Thanks for the information!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
204.13 In reply to 204.11 
Hi Michael,

After releasing new beta you have surely time for hanging around... hehe... Anyway, could you spend some time advising me on scripting?

I'd like to make a script enabling to define a two-key shortcuts for a given group of commands. I've written some code, but I'm not able to find any MoI's object that can receive a keyboard event. I've also tried ineffectually to grab some UI using getUIPanel() method for window.event.keyCode property.

I'm just wondering if is there currently a way to get the following script working or I must write related html file with a form and "onkeypress/onchange..." handling.


// boolean group is called with shortcut B=Booleans.js

// something is missing here...

while ( 1 )
{
        var key = WHICH_OBJECT?.event.keyCode;

        if ( typeof( key ) == 'number' )
                break;
}

var keychar = String.fromCharCode( key ).toLowerCase();

// bu ->BooleanUnion
if      ( keychar == 'u' )
        moi.command.execCommand( 'BooleanUnion' );
// bd ->BooleanDifference 
else if ( keychar == 'd' )
        moi.command.execCommand( 'BooleanDifference' );
// bi ->BooleanIntersection 
else if ( keychar == 'i' )
        moi.command.execCommand( 'BooleanIntersection' );


Thanks,
Petr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
204.14 In reply to 204.13 

Just a problem of design !
"Yellow words" are unreadible over white page! :)
Maybe orange?

---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
204.15 In reply to 204.13 
Hi Petr, there isn't any way to do that exactly right now. Right now keystrokes don't generate any particular scriptable MoI-specific events, since they are more intended to launch keyboard shortcuts from the moi.ini file.

I've attached one method - this is set up as a command, not a script, so set the keyboard shortcut as B=BoolLaunch (no .js at the end).

Note that you need to explicitly set focus on to the particular element so that it will receive keyboard events.

Still there is a problem - if you have any keyboard shortcuts set up for "i", "d", or "u", those will always get triggered with a keystroke and the shortcut will eat the keystroke so I don't think the regular HTML event will trigger in that case. There is a special case for this if you have a numeric input and your keystroke is a numeric character, it won't eat it in that case but there isn't a way to override shortcuts for other keystrokes right now.

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  tyglik
204.16 In reply to 204.15 
Hi Michael,

Thanks for helping.

>>Still there is a problem - if you have any keyboard shortcuts
>>set up for "i", "d", or "u", those will always get
>>triggered with a keystroke and the shortcut will eat
>>the keystroke so I don't think the regular HTML event
>>will trigger in that case.

I have tried it and noticed that a keyboard shortcut is eaten by the keystroke only when defining scripts directly. For instance I set the shortcut I=script:moi.geometryDatabase.invertSelection();" then typing "bi" (the alias for BooleanIntersection in the "BoolLaunch.htm" file) triggers both Invert and BooleanIntersection command.

But there is way to trigger only the BooleanIntersection command by typing alias in case I make the "Invert.js" file with a script for inverting selection, copy it to the \commands directory and define the shortcut "I=Invert".
Unfortunately, it causes that the shortcut "I" cannot be used further to invert a selection from within running command since it aborts current one.

Anyway, I guess there are more important things to do for V1,V2 than an issue of aliases...

Petr

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All