sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Icon to layer connection?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 2 Posters 109 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      tomot
      last edited by

      Being well organized and constant monitoring on which layer elements are drawn on is paramount in SketchUp. With that in mind, I'm wondering if its now possible to write a Ruby that would be included in the System Preferences menu with the following:

      1. user check/uncheck box
      2. create a link between the Dim icon and automatically create and turn on a Dimension Layer
      3. revert back to the Default layer when another Icon is picked?

      [my plugins](http://thingsvirtual.blogspot.ca/)
      tomot

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        @tomot said:

        ..., I'm wondering if its now possible to write a Ruby that would be included in the System Preferences menu with the following:

        1. user check/uncheck box

        The API does NOT expose any methods to add or change controls, to the System Preferences dialog.

        @tomot said:

        1. create a link between the Dim icon and automatically create and turn on a Dimension Layer

        The DimensionTool is a native tool, linked to a button, on a native toolbar (which are not the same as a Ruby UI::Toolbar instance.) So we cannot directly effect that toolbar or it's tools.

        However, we (you) CAN indirectly effect them via a ToolsObserver, that watches the toolstack, and changes the active layer (to a User preferred layer,) when the active_tool_id == the id for the DimensionTool. Also, first save the PREVIOUS layer to a var.

        @tomot said:

        1. revert back to the Default layer when another Icon is picked?

        Your observer would have to track that it is "in Dim mode", and when the active_tool_id != the id for the DimensionTool AND it WAS "in Dim mode", change the layer back to the PREVIOUS layer, and set the "Dim mode" var to false.

        Your plugin would have to show a Yes/No messagebox, asking the user if they wanted to create a NEW dimension layer or choose an existing one.
        Then (depending upon the messagebox choice,) either display a "New Layer" textname inputbox, or display an inputbox to the user allowing them to choose one of the existing layers from a dropdown list.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • T Offline
          tomot
          last edited by

          I can see this to be invaluable addition to the API, Even using AutoCad many years ago one had the ability to construct user menus with icon automated tasks like putting text on a text layer, dimensions on a dim layer
          etc. Perhaps this should be on a wish list. πŸŽ‰

          [my plugins](http://thingsvirtual.blogspot.ca/)
          tomot

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            Your missing the point!

            The native Dim tool belongs to Google, in the same way that SelectionToys belongs to ThomThom.

            It is very important for Google to have a set of basic tools, that operate the same for everyone. This way all of their tutorials and help texts make sense.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • T Offline
              tomot
              last edited by

              @dan rathbun said:

              Your missing the point!

              No your missing the point or perhaps I'm not explaining myself correctly. Its about the ability for the END USER to Customize the main program. For example: Using Autolisp I can create and title as many drop down menus for AutoCad as I want. While in SU I can't even create a secondary Plugins menu.

              [my plugins](http://thingsvirtual.blogspot.ca/)
              tomot

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                I know what AutoCAD can do (I've been using it for over 25 years.)

                Suddenly your talking menus (which I have no problem creating in Sketchup. I can even using system calls create a toplevel menu, if I wish to. But Google does not seem to want us to do this in a general sense. They want everyone's main menubar to look the same, for tutorial purposes, I suppose.)

                Back, on saubject. Commands. The API allows us to create commands. I even told you how I would do the specific one you ask about.

                I am in the process of creating my own Cline tool, so perhaps I'll expand it a bit to Text, Dimension, and 3Dtext; .. since I was gonna have a default Cline Layer. It would be just adding in some more elsif clauses, and so forth.

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement