Icon to layer connection?
-
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:
- user check/uncheck box
- create a link between the Dim icon and automatically create and turn on a Dimension Layer
- revert back to the Default layer when another Icon is picked?
-
@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:
- user check/uncheck box
The API does NOT expose any methods to add or change controls, to the System Preferences dialog.
@tomot said:
- 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 RubyUI::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 theactive_tool_id
== the id for theDimensionTool
. Also, first save the PREVIOUS layer to a var.@tomot said:
- 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 theDimensionTool
AND it WAS "in Dim mode", change the layer back to the PREVIOUS layer, and set the "Dim mode" var tofalse
.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 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. -
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.
-
@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.
-
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.
Advertisement