Matt,
Cool, I'll have a look. And of course, thanks of starting the orginal series of units plugins.
-Kwok
Matt,
Cool, I'll have a look. And of course, thanks of starting the orginal series of units plugins.
-Kwok
@thomthom said:
@kyyu said:
Dan, I now see I didn't understand alot of it until, you just explained more. When you use @@tool to save the tool instance, do you think there are efficiency gains?
For one it would allow you to store the state of the tool...
Thomas, could you give a real simple example of this. I know you can save @@variables, that will be remembered within a SU session. But confused by the tool state, being remembered with the instance.
Dan, I now see I didn't understand alot of it until, you just explained more. When you use @@tool to save the tool instance, do you think there are efficiency gains?
tomot, my layman's answer is you need to prefix the module method with the module name space. Even though; in your example, you don't use the method you defined. Instead of "def righttriangle", it should be "def TOMOT.righttriangle" or "def self.righttriangle".
@rock1 said:
i select a box [which is a group], press "s", then click the 1st button of toolbar. nothing happens
Because the scale tool does not know to update it's handles drawing. You have to force it to redraw. Either by selecting a handle, like Dave R, suggested. Or by reselecting the group. Deselect by pressing [Esc]key or right clicking on an empty spot on the screen. And reselect the group.
@rock1 said:
if i select the box, then click the button, it doesn't get pressed at all
The button doesn't depress for selection. If there is nothing selected, then all active group/components are processed and the button is depressed as an indicator that every thing was processed.
If you want to use thomthom's idea of hiding the handles, my Simple Scale Handles plugin can be easily modified to hide them all. And it would work for groups, too.
You can test it out with these one liners, in the ruby console. Have the component/group selected:
For Groups:
Sketchup.active_model.selection[0].entities.parent.behavior.no_scale_mask=127
For Components:
Sketchup.active_model.selection[0].definition.behavior.no_scale_mask=127
Set the value back to zero, to undo.
@rock1 said:
i'm having a problem using this tool. when i click either of the two toolbars button, the default scaling handles remain. they never change to the simple scale tool what should i do?
Do you have a group or component, in your drawing, for the plugin to modify? You can give it a try under the plugins menu, but no one else has reported a problem with the toolbar?
@jojo9 said:
Code 1 is designated for a standalone script, right? (like: #jojo9_startup.rb)
No, it just shows how to save a reference to the submenu item. It doesn't have to be in a loader/startup script. If you want an example, look at my Pushpull & Group plugin: http://forums.sketchucation.com/viewtopic.php?t=28072 I wrote it using 2 global variables, but I have figure out since then that you only need 1. You will see that in my plugin, "Code 1" is actually in "Code 2", where it saids "else something".
@jojo9 said:
Hi Kyyu,
i'm confused.
I think you say I need to merge the relevant scripts, (who has to live in the same subfolder) into one longer script?
Because two scripts cannot load at the same time and scripts load hierarchically, after the abc, not?
No, you don't need to merge into one big script. You need to to save a reference to the submenu object, when it's created. For example, using a global varable. But make sure it is unique:
$jojo9_submenu=UI.menu('Plugins').add_submenu("[jojo9]")
$jojo9_submenu.add_item("Item1") { puts "Item1"}
Then in the next plugin something like this:
if $jojo9_submenu
$jojo9_submenu.add_item("Item2") { puts "Item2"}
else
something
end