[Code] Sketchup.send_action() : Arguments to
-
No action for the Follow Me tool? (That works on both platforms.)
-
@thomthom said:
No action for the Follow Me tool? (That works on both platforms.)
don't know what works on a PC, but since your probably missing the mac one...
Sketchup.send_action('selectExtrudeTool;')
I'll add this to my list...
I've got a osascript test runner, for running the lot if you want it...
john -
Excellent! I didn't realise that was it's internal name. Doh!
Yea, run the lot and see what you get.
-
I think early versions of SketchUp called it the 'Extrude Tool', later it was renamed 'FollowMe' but the original 'coded' name remains - which is like 'Scenes' are really 'Pages', 'Guides' are really 'Clines' etc, and other foibles that you can probably list too !
-
Yea - there's lots of legacy strangeness to discover when traversing the API.
-
possibly new for v2013 on mac at least
Sketchup.send_action('closeDocument;') Sketchup.send_action('newDocument;') Sketchup.send_action('saveDocument;') Sketchup.send_action('openDocument;') Sketchup.send_action('printDocument;')
@Dan, thanks for the trigger to test them...
-
@driven said:
possibly new for v2013 on mac at least
Sketchup.send_action('closeDocument;') > > Sketchup.send_action('newDocument;') > > Sketchup.send_action('saveDocument;') > > Sketchup.send_action('openDocument;') > > Sketchup.send_action('printDocument;') >
@Dan, thanks for the trigger to test them...
Some of those have been around BUT 'undocumented' for some time [v8M2].
The 'saveDocument:' is particularly useful because callingmodel.save(model.path)
does NOT save the model BUT returns 'true'.
So if you want to ensure the model is saved before saving it as another name, that send_action is needed...
Here's a list that I have for those v8M2 changes - some were documented but * == undocumented & ! == broken on MAC:
addBuilding: !
copy: *
cut: *
editDelete: *
getCurrentView: *
getModels: *!
getPhotoTexture: !
newDocument: *
openDocument: *
paste: *
placeModel: *
printDocument: *
saveDocument: *
select3dTextTool: *
selectionZoomExt: *
shareModel: *!
showRubyPanel:
uploadComponent: *!
viewShowGuides: * -
This is my latest list, some may be mac only, some new, some missing
Sketchup.send_action('addBuilding;') #! dosn't work on mac Sketchup.send_action('getPhotoTexture;') #! dosn't work on mac
#/ Sketchup.send_action('closeDocument;') Sketchup.send_action('newDocument;') Sketchup.send_action('openDocument;') # dialog drop-down sheet Sketchup.send_action('printDocument;') # direct print of current view @current settings Sketchup.send_action('saveDocument;') # dialog drop-down sheet
#/ Sketchup.send_action('editHide;') Sketchup.send_action('editRedo;') Sketchup.send_action('editUndo;') Sketchup.send_action('editUnhide;') #! dosn't work on mac Sketchup.send_action('editUnhideAll;') #* does work on mac Sketchup.send_action('editUnhideLast;') #* does work on mac
#/ Sketchup.send_action('fixNonPlanarFaces;')
#/ Sketchup.send_action('pageAdd;') Sketchup.send_action('pageDelete;') Sketchup.send_action('pageNext;') Sketchup.send_action('pagePrevious;') Sketchup.send_action('pageUpdate;')
#/ Sketchup.send_action('renderHiddenLine;') Sketchup.send_action('renderMonochrome:') Sketchup.send_action('renderShaded;') Sketchup.send_action('renderTextures;') Sketchup.send_action('renderWireframe;')
#/ Sketchup.send_action('selectAll;') #NEW? does work on mac but not('editSelectAll;') Sketchup.send_action('selectArcTool;') Sketchup.send_action('selectAxisTool;') Sketchup.send_action('selectCircleTool;') Sketchup.send_action('selectDimensionTool;') Sketchup.send_action('selectDollyTool;') Sketchup.send_action('selectEraseTool;') Sketchup.send_action('selectExtrudeTool;') Sketchup.send_action('selectFieldOfViewTool;') Sketchup.send_action('selectFreehandTool;') Sketchup.send_action('selectImageIglooTool;') Sketchup.send_action('selectLineTool;') Sketchup.send_action('selectMeasureTool;') Sketchup.send_action('selectMoveTool;') Sketchup.send_action('selectNorthTool;') Sketchup.send_action('selectOffsetTool;') Sketchup.send_action('selectOrbitTool;') Sketchup.send_action('selectPaintTool;') Sketchup.send_action('selectPolygonTool;') Sketchup.send_action('selectPositionCameraTool;') Sketchup.send_action('selectProtractorTool;') Sketchup.send_action('selectPushPullTool;') Sketchup.send_action('selectRectangleTool;') Sketchup.send_action('selectRotateTool;') Sketchup.send_action('selectScaleTool;') Sketchup.send_action('selectSectionPlaneTool;') Sketchup.send_action('selectSelectionTool;') Sketchup.send_action('selectTextTool;') Sketchup.send_action('selectTurnTool;') Sketchup.send_action('selectWalkTool;') Sketchup.send_action('selectZoomTool;') Sketchup.send_action('selectZoomWindowTool;')
#/ Sketchup.send_action('viewBack;') Sketchup.send_action('viewBottom;') Sketchup.send_action('viewFront;') Sketchup.send_action('viewIso;') Sketchup.send_action('viewLeft;') Sketchup.send_action('viewParallelProjection;') #* does work on mac •toggle Sketchup.send_action('viewPerspective;') #* does work on mac •toggle Sketchup.send_action('viewRight;') Sketchup.send_action('viewShowAxes;') Sketchup.send_action('viewShowAxes;') #* does work on mac •toggle Sketchup.send_action('viewShowGuides;') #* does work on mac •toggle Sketchup.send_action('viewShowHidden;') #* does work on mac •toggle Sketchup.send_action('viewTop;') Sketchup.send_action('viewTwoPointPerspective;') #* does work on mac Sketchup.send_action('viewUndo;') Sketchup.send_action('viewZoomExtents;') Sketchup.send_action('viewZoomToSelection;')
#/ Sketchup.send_action('showRubyPanel;')
#/ Sketchup.send_action('cut;')
#/ Sketchup.send_action('copy;')
#/ Sketchup.send_action('paste;')
#/ Sketchup.send_action('pasteInPlace;')
#/ Sketchup.send_action('editDelete;')
forgot the bottom one, and I think I have a few others... somewhere...
-
Is there any action to edit a group/component (similar as double clicking on a group)?
-
@mythos said:
Is there any action to edit a group/component (similar as double clicking on a group)?
No.
I have PM'd you a suggestion with a method usingview.pick_helper.path_at[-2]
, to select the picked object's container, then using the [forced open]Outliner
to open that now selected group/instance for editing... -
Has anyone found a cross-platform string to send the model to Layout ?
On the PC only this works:
Sketchup::send_action( 23051 )
-
@dan rathbun said:
Has anyone found a cross-platform string to send the model to Layout ?
On the PC only this works:
Sketchup::send_action( 23051 )
John confirmed that
Sketchup::send_action("sendToLayOut:")
works on Mac.So that gives us a cross-platform method
<span class="syntaxdefault">def send_active_model_to_layout</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault"> return nil unless Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">is_pro</span><span class="syntaxkeyword">?<br /></span><span class="syntaxdefault"> if </span><span class="syntaxkeyword">(</span><span class="syntaxdefault">Sketchup</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">respond_to</span><span class="syntaxkeyword">?(;</span><span class="syntaxdefault">platform</span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">&&<br /></span><span class="syntaxdefault"> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">platform </span><span class="syntaxkeyword">==</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">;</span><span class="syntaxdefault">platform_win </span><span class="syntaxkeyword">)</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">||<br /></span><span class="syntaxdefault"> RUBY_PLATFORM </span><span class="syntaxkeyword">!~</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">/(</span><span class="syntaxdefault">darwin</span><span class="syntaxkeyword">)/</span><span class="syntaxdefault">i<br /> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">send_action</span><span class="syntaxkeyword">(</span><span class="syntaxdefault"> 23051 </span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> else<br /> Sketchup</span><span class="syntaxkeyword">;;</span><span class="syntaxdefault">send_action</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"sendToLayOut;"</span><span class="syntaxkeyword">)<br /></span><span class="syntaxdefault"> end<br />end<br /></span>
EDIT: inserted Pro only bailout statement to return
nil
if not SketchUp Pro. -
it's been a while and maybe everyone has lost interest, but I found a few more for the mac list...
the big question is, how many of these run on a PC?
single # denotes a Menu Title, ## Item Title, ### hard coded shortcut combo...
# SketchUp Sketchup.send_action('showAboutBox;') ## About SketchUp Sketchup.send_action('showSketchUpPreferences;') ## Preferences... Sketchup.send_action('manageLicenses;') ## License... Sketchup.send_action('checkWebUpdate;') ## Check Web for Update... Sketchup.send_action('hide;') ## Hide SketchUp ### ⌘H Sketchup.send_action('hideOtherApplications;') ## Hide Others ### ⌘H Sketchup.send_action('unhideAllApplications;') ## Show All Sketchup.send_action('terminate;') ## Quit SketchUp ### ⌘Q # File Sketchup.send_action('newDocument;') ## New ### ⌘N Sketchup.send_action('openDocument;') ## Open... ### ⌘O Sketchup.send_action('clearRecentDocuments;') ## Clear Menu Sketchup.send_action('performClose;') ## Close ### ⌘W Sketchup.send_action('saveDocument;') ## Save ### ⌘S Sketchup.send_action('saveDocumentAs;') ## Save As... ### ⇧⌘S Sketchup.send_action('saveCopy;') ## Save A Copy As... Sketchup.send_action('saveAsTemplate;') ## Save As Template... Sketchup.send_action('revertDocumentToSaved;') ## Revert Sketchup.send_action('sendToLayOut;') ## Send to LayOut Sketchup.send_action('importFromGoogleEarth;') ## Add Location... Sketchup.send_action('clearLocation;') ## Clear Location Sketchup.send_action('toggleTerrain;') ## Show Terrain Sketchup.send_action('browse3DWarehouse;') ## Get Models... Sketchup.send_action('shareWithGoogleEarthCommunity;') ## Share Model... Sketchup.send_action('runImporter;') ## Import... Sketchup.send_action('runPageLayout;') ## Page Setup... ### ⇧⌘P Sketchup.send_action('runDocumentSetup;') ## Document Setup... Sketchup.send_action('printDocument;') ## Print... ### ⌘P # Edit Sketchup.send_action('editUndo;') ## Undo ### ⌘Z Sketchup.send_action('editRedo;') ## Redo ### ⇧⌘Z Sketchup.send_action('cut;') ## Cut ### ⌘X Sketchup.send_action('copy;') ## Copy ### ⌘C Sketchup.send_action('paste;') ## Paste ### ⌘V Sketchup.send_action('pasteInPlace;') ## Paste In Place Sketchup.send_action('editDelete;') ## Delete Sketchup.send_action('eraseConstructionGeometry;') ## Delete Guides Sketchup.send_action('selectAll;') ## Select All ### ⌘A Sketchup.send_action('deselectAll;') ## Select None ### ⇧⌘A Sketchup.send_action('editHide;') ## Hide ### ⌘E Sketchup.send_action('editUnhide;') ## Selected Sketchup.send_action('editUnhideLast;') ## Last Sketchup.send_action('editUnhideAll;') ## All ### ⇧⌘E Sketchup.send_action('editLock;') ## Lock Sketchup.send_action('editUnlockSelected;') ## Selected Sketchup.send_action('editUnlockAll;') ## All Sketchup.send_action('makeComponent;') ## Make Component... ### ⇧⌘G Sketchup.send_action('makeGroup;') ## Make Group ### ⌘G Sketchup.send_action('closeGroupOrComponent;') ## Close Group/Component ### ⇧⌘G Sketchup.send_action('intersectWithModel;') ## With Model Sketchup.send_action('intersectSelected;') ## With Selection Sketchup.send_action('intersectWithContext;') ## With Context # View Sketchup.send_action('toggleToolPalette;') ## Large Tool Set Sketchup.send_action('toggleSolidModelToolPalette;') ## Solid Tools Sketchup.send_action('toggleGoogleToolPalette;') ## Location Sketchup.send_action('toggleWarehouseToolPalette;') ## Warehouse Sketchup.send_action('togglePageTabsDsiplay;') ## Scene Tabs Sketchup.send_action('viewShowHidden;') ## Hidden Geometry Sketchup.send_action('sectionToggleDisplay;') ## Section Planes Sketchup.send_action('sectionToggleActivation;') ## Section Cuts Sketchup.send_action('viewShowAxes;') ## Axes Sketchup.send_action('viewShowGuides;') ## Guides Sketchup.send_action('toggleShadows;') ## Shadows Sketchup.send_action('toggleFog;') ## Fog Sketchup.send_action('toggleDisplayEdges;') ## Edges Sketchup.send_action('toggleDisplayBackEdges;') ## Back Edges Sketchup.send_action('toggleProfiles;') ## Profiles Sketchup.send_action('toggleDepthQue;') ## Depth Cue Sketchup.send_action('toggleExtensions;') ## Extension Sketchup.send_action('toggleGlobalTransparency;') ## X-ray Sketchup.send_action('renderWireframe;') ## Wireframe Sketchup.send_action('renderHiddenLine;') ## Hidden Line Sketchup.send_action('renderShaded;') ## Shaded Sketchup.send_action('renderTextures;') ## Shaded With Textures Sketchup.send_action('renderMonochrome:') ## Monochrome Sketchup.send_action('toggleHideRestOfModel;') ## Hide Rest of Model Sketchup.send_action('toggleHideSimilarComponents;') ## Hide Similar Components Sketchup.send_action('pageAdd;') ## Add Scene Sketchup.send_action('pageUpdate;') ## Update Scene Sketchup.send_action('pageDelete;') ## Delete Scene Sketchup.send_action('pagePrevious;') ## Previous Scene Sketchup.send_action('pageNext;') ## Next Scene Sketchup.send_action('slideshowStart;') ## Play Sketchup.send_action('pageOptions;') ## Settings Sketchup.send_action('toggleToolbarShown;') ## Hide Toolbar Sketchup.send_action('runToolbarCustomizationPalette;') ## Customize Toolbar ... # Draw Sketchup.send_action('selectLineTool;') ## Line ### ⌘L Sketchup.send_action('selectFreehandTool;') ## Freehand ### ⌘F Sketchup.send_action('selectArc3PointTool;') ## Arc ### ⌘J Sketchup.send_action('selectArcTool;') ## 2 Point Arc Sketchup.send_action('select3PointFitArcTool;') ## 3 Point Arc Sketchup.send_action('selectArcPieTool;') ## Pie Sketchup.send_action('selectRectangleTool;') ## Rectangle ### ⌘K Sketchup.send_action('selectRectangle3PointTool;') ## Rotated Rectangle Sketchup.send_action('selectCircleTool;') ## Circle Sketchup.send_action('selectPolygonTool;') ## Polygon # Camera Sketchup.send_action('viewUndo;') ## Previous Sketchup.send_action('viewRedo;') ## Next Sketchup.send_action('viewTop;') ## Top ### ⌘1 Sketchup.send_action('viewBottom;') ## Bottom ### ⌘2 Sketchup.send_action('viewFront;') ## Front ### ⌘3 Sketchup.send_action('viewBack;') ## Back ### ⌘4 Sketchup.send_action('viewLeft;') ## Left ### ⌘5 Sketchup.send_action('viewRight;') ## Right ### ⌘6 Sketchup.send_action('viewIso;') ## Iso ### ⌘7 Sketchup.send_action('viewParallelProjection;') ## Parallel Projection Sketchup.send_action('viewPerspective;') ## Perspective Sketchup.send_action('viewTwoPointPerspective;') ## Two-Point Perspective Sketchup.send_action('cameraMatchNewPhoto;') ## Match New Photo... Sketchup.send_action('editPhotoMatch;') ## Edit Matched Photo Sketchup.send_action('selectOrbitTool;') ## Orbit ### ⌘B Sketchup.send_action('selectDollyTool;') ## Pan ### ⌘R Sketchup.send_action('selectZoomTool;') ## Zoom Sketchup.send_action('selectFieldOfViewTool;') ## Field of View Sketchup.send_action('selectZoomWindowTool;') ## Zoom Window Sketchup.send_action('viewZoomExtents;') ## Zoom Extents Sketchup.send_action('viewZoomToSelection;') Sketchup.send_action('viewZoomImage;') ## Zoom to Photo Sketchup.send_action('selectPositionCameraTool;') ## Position Camera Sketchup.send_action('selectWalkTool;') ## Walk Sketchup.send_action('selectTurnTool;') ## Look Around Sketchup.send_action('selectImageIglooTool;') ## Image Igloo # Tools Sketchup.send_action('selectSelectionTool;') ## Select Sketchup.send_action('selectEraseTool;') ## Eraser Sketchup.send_action('selectPaintTool;') ## Paint Bucket Sketchup.send_action('selectMoveTool;') ## Move ### ⌘0 Sketchup.send_action('selectRotateTool;') ## Rotate ### ⌘8 Sketchup.send_action('selectScaleTool;') ## Scale ### ⌘9 Sketchup.send_action('selectPushPullTool;') ## Push/Pull Sketchup.send_action('selectExtrudeTool;') ## Follow Me Sketchup.send_action('selectOffsetTool;') ## Offset Sketchup.send_action('selectOuterShellTool;') ## Outer Shell Sketchup.send_action('selectUnionTool;') ## Union Sketchup.send_action('selectDifferenceTool;') ## Subtract Sketchup.send_action('selectDifferenceNDTool;') ## Trim Sketchup.send_action('selectIntersectTool;') ## Intersect Sketchup.send_action('selectBooleanSplitTool;') ## Split Sketchup.send_action('showSolidModelToolsMenu;') ## Split Sketchup.send_action('selectMeasureTool;') ## Tape Measure ### ⌘D Sketchup.send_action('selectProtractorTool;') ## Protractor Sketchup.send_action('selectAxisTool;') ## Axes ### ⌘F Sketchup.send_action('selectDimensionTool;') ## Dimensions Sketchup.send_action('selectTextTool;') ## Text Sketchup.send_action('doThreeDText;') ## 3D Text Sketchup.send_action('selectSectionPlaneTool;') ## Section Plane ### ⌘Y # Window Sketchup.send_action('performMiniaturize;') ## Minimize ### ⌘M Sketchup.send_action('performZoom;') ## Zoom Sketchup.send_action('showModelPropertiesPanel;') ## Model Info ### ⇧⌘I Sketchup.send_action('entityProperties;') ## Entity Info ### ⌘I Sketchup.send_action('orderFrontColorPanel;') ## Materials ### ⇧⌘C Sketchup.send_action('showComponentBrowser;') ## Components Sketchup.send_action('showStyleBrowser;') ## Styles Sketchup.send_action('showLayerPanel;') ## Layers Sketchup.send_action('showOutliner;') ## Outliner Sketchup.send_action('showPagePanel;') ## Scenes Sketchup.send_action('orderFrontFontPanel;') ## Show Fonts ### ⌘T Sketchup.send_action('showRubyConsole;') ## Ruby Console Sketchup.send_action('showShadowsPanel;') ## Shadows Sketchup.send_action('showFogSettingsPanel;') ## Fog Sketchup.send_action('showPhotoMatchPanel;') ## Match Photo Sketchup.send_action('showSoftenEdgesPanel;') ## Soften Edges Sketchup.send_action('showInstructor;') ## Instructor Sketchup.send_action('browse3DWarehouse;') ## 3D Warehouse Sketchup.send_action('browseExtensionStore;') ## Extension Warehouse Sketchup.send_action('toggleInspectors;') ## Hide Dialogs Sketchup.send_action('getPhotoTexture;') ## Photo Textures !!!!!!!!!!!! not working Sketchup.send_action('arrangeInFront;') ## Bring All to Front # Help Sketchup.send_action('showWelcomePanel;') ## Welcome To SketchUp… Sketchup.send_action('showOnlineHelpCenter;') ## Knowledge Center Sketchup.send_action('contactUs;') ## Contact Us # Orphans Sketchup.send_action('fixNonPlanarFaces;') ## Model Info >> Statistics >> Fix Problems
I may have missed some...
john
Advertisement