sketchucation logo sketchucation
    • Login
    1. Home
    2. brandenberg
    3. Posts
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Sketchup.send_action arguments: Mac vs PC

      This is an old thread, but I'm adding a tip here that may be of help to other developers who may discover this info...

      In an effort to create a toolbar button to show the "Entity Info" palette (there's a built-in button for Model Info, but oddly not for Entity Info), I couldn't find a method or action that worked on the Mac. There is a fixnum constant value for the PC, but these don't seem to work on the Mac, even after years of SketchUp evolution on the Mac. Then I stumbled on the get_shortcuts method...

      Using the "Shortcuts" pane within the "Preferences" window, you can add a shortcut to the command for which you need the string constant, then using:

      Sketchup.get_shortcuts.sort

      ...you can discover the string that can successfully be used with the Sketchup.send_action method. For example, I added the F2 key to "Window/Entity Info", and got the following output:

      Sketchup.get_shortcuts.sort
      ["A\tselectSelectionTool:", "B\tselectPaintTool:", "C\tselectCircleTool:", "E\tselectEraseTool:", "F\tviewZoomExtents:", "F2\tentityProperties:", "G\tmakeGroup:", "H\tselectDollyTool:", "K\ttoggleDisplayBackEdges:", "L\tselectLineTool:", "O\tselectOrbitTool:", "P\tselectPushPullTool:", "R\tselectRotateTool:", "S\tselectScaleTool:", "T\tselectMeasureTool:", "V\tselectMoveTool:", "Z\tselectZoomTool:", "`\ttoggleHideRestOfModel:", "~\ttoggleHideSimilarComponents:", "⇧G\t/Edit/Context Menu Flyout/Explode"]

      In there, you'll see "F2\tentityProperties:", so the string constant is "entityProperties:".

      Voila, a method to discover undocumented action strings.

      posted in Developers' Forum
      B
      brandenberg
    • 1 / 1