|
Keys or key combinations can be assigned to different actions under Options / Shortcut keys. The Enter and Esc keys have predefined functions. You can use Enter as a shortcut for clicking the "Done" button while inside of a command, and pressing it outside of a command will repeat the last used command. Esc is used to cancel or turn off modes. If you are currently running a command, Esc will cancel the command same as clicking the "Cancel" button. If you are outside of a command, Esc will deselect objects on the first tap, and then turn off any points that were enabled with the "Show pts" command on the next tap. To create a new shortcut key, click the "Add" button and then fill in the entries for Key and Command. The key can be defined using a letter (like "A") or one of these labels: F1 - F12, UpArrow, DownArrow, LeftArrow, RightArrow, Home, End, PageUp, PageDown, Insert, Delete, Backspace, Space. The key can be prefixed by one or more of these modifiers: Ctrl+ , Shift+, or Alt+ . Examples of some key assignments: | A | = push the A key with no other modifier keys. | | Ctrl+A | = hold down Ctrl and push A | | Ctrl+Shift+A | = hold down both Ctrl and Shift and push A. | | Ctrl+UpArrow | = hold down Ctrl and push the Up arrow. | The Command can be filled in with either the name of a command, or a script macro. Script macros are prefixed with the keyword "script:". Command names: AddPoint, Align, Arc3pt, ArcCenter, ArcContinue, ArcTangent, ArrayCircular, ArrayCurve, ArrayDir, ArrayGrid, Blend, BooleanDifference, BooleanIntersection, BooleanMerge, BooleanUnion, Box, Box3pts, BoxCenter, Chamfer, Circle, Circle3pt, CircleDiameter, CircleTangent, Cone, Copy, CopyClipboard, Curve, Cut, Cylinder, Delete, Ellipse, EllipseCorner, EllipseDiameter, Export, Extend, Extrude, Fillet, Helix, History, Image, Import, IncrementalSave, InterpCurve, Intersect, Join, Line, Loft, Mirror, Move, Network, New, Offset, Open, Paste, PlanarSrf, Plane, Plane3pts, PlaneCenter, Point, Polygon, PolygonEdge, PolygonStar, Polyline, Project, RailRevolve, Rect3pts, Rectangle, RectCenter, Revolve, Rotate, RotateAxis, Save, SaveAs, Scale, Scale1D, Scale2D, Separate, Shell, ShowPoints, ShrinkTrimmedSrf, SketchCurve, Sphere, Sweep, Text, Trim So for example, a shortcut for E to activate extrude would look like this: E Extrude There are a few buttons in the UI that run script macros instead of commands: Hide, Reset all, Select all, Deselect all, and Invert. This is so they can be used while a command is still running, so these functions are slightly different than a regular command. To hook these up to a shortcut key fill in the Command part with one of the following scripts: Hide: script:moi.geometryDatabase.hide(); Reset all views: script:moi.view.resetAll(); Select all: script:moi.geometryDatabase.selectAll(); Deselect all: script:moi.geometryDatabase.deselectAll(); Invert selection: script:moi.geometryDatabase.invertSelection(); Here are some frequently requested scripts that can be assigned to a key to perform a custom action. To use these, copy the entire line that begins with script: and paste it into the Command part of the shortcut key: Maximize the view the mouse is over, or switch back to split view (usually assigned to Space key): script:if ( moi.ui.mainWindow.viewpanel.mode != 'split' ) { moi.ui.mainWindow.viewpanel.mode = 'split' } else { var viewport = moi.ui.getViewportUnderMouse(); if ( viewport ) { viewport.viewPanel.mode = viewport.name } } Go to split view: script:moi.ui.mainWindow.viewpanel.mode = 'Split'; Maximize the 3D view: script:moi.ui.mainWindow.viewpanel.mode = '3D'; Maximize the Front view: script:moi.ui.mainWindow.viewpanel.mode = 'Front'; Maximize the Right view: script:moi.ui.mainWindow.viewpanel.mode = 'Right'; Isolate the selection (hide everything else that is not selected): script:moi.geometryDatabase.invertSelection(); moi.geometryDatabase.hide(true); Select all curve objects: script:moi.geometryDatabase.getObjects().getCurves().setProperty( 'selected', true ); Select all open curves (curves that do not form a closed loop): script:var curves = moi.geometryDatabase.getObjects().getCurves(); for ( var i = 0; i < curves.length; ++i ) if ( !curves.item(i).isClosed ) curves.item(i).selected = true; Hide all curve objects: script:moi.geometryDatabase.getObjects().getCurves().setProperty( 'hidden', true ); Hide all surface/solid objects: script:moi.geometryDatabase.getObjects().getBReps().setProperty( 'hidden', true ); Select all objects that were created by the last command: script:var a = moi.command.lastCommandRevisionStart; var b = moi.command.lastCommandRevisionEnd; var objects = moi.geometryDatabase.getObjects(); for ( var i = 0; i < objects.length; ++i ) { var obj = objects.item(i); if ( obj.databaseRevision > a && obj.databaseRevision <= b ) obj.selected = true; } Toggle grid snap on or off: script:moi.drawingAids.gridSnap = !moi.drawingAids.gridSnap; Toggle object snap on or off: script:moi.drawingAids.objectSnap = !moi.drawingAids.objectSnap; Toggle straight snap on or off: script:moi.drawingAids.straightSnap = !moi.drawingAids.straightSnap; Toggle the light direction: script:var dir = moi.view.lightDirection; if ( dir.x == 1 && dir.y == 1 && dir.z == -1 ) { dir.set(-0.5,1,0); } else { dir.set(1,1,-1); } moi.view.lightDirection = dir;
|