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
How about comparing distance to face center points (face.bounds.center)?
You need to get a reference to the submenu object, when it's 1st created.
Is this what you want? Althought, it saids it has issues with the mac. Seems like it actually edit's your plugin files, which seems dangerous. That's why it so hard. You would have to modify every ruby file. I've not used it.
http://www.smustard.com/script/Organizer
@unknownuser said:
Known issues: Original object is exploded which obviously isnt soo great. (See line 124 under "activate".)
I tweaked all 3 tools so, you don't have to explode that group. You still have to start with an ungrouped box, like before, that the plugin itself groups. I kinda have zero experience in texturing, but want to learn, so messed around with it a bit. I'm interested in unwrapping, too.
Try this:
def method_name(pt1, pt2, width)
vec = pt2 - pt1
ang = 90.degrees
rotate = Geom;;Transformation.rotation( pt1, Geom;;Vector3d.new(0, 1, 0), ang)
vec = vec.transform(rotate)
pt11 = pt1.offset(vec, width)
end
@tig said:
Kyyu
Strange it should look at each face the same way...
Can you supply that SKP so I can test it ?
How thin are the faces? 2.95mm might creep in ?
TIG, I didn't save the original one, but I made up another one. The width was 2mm. Got similar result.
Hi Tig,
Works fine in simple cases, but missed some faces in this crossed pattern.
Hi jolran,
@unknownuser said:
- So you mean I should stop developing it until I have matured?
@unknownuser said:
Everyone knows what beta means......If the plugin is not good enough for publishing I can remove it and post when I "feel" ready? Feel's like I have broken some unwritten rule here..
No, I am not telling you to stop developing. And no I don't want you to remove it.
You should not take offense, as I am just trying to give you the best advice I can. I debated if I should say anything at all. So don't take it the wrong way and be discouraged.
You are right. I don't know what you are going. Anyways, I hope you see something in my example that helps you.
@unknownuser said:
Is the code example you provided tested?
Yes, it works 100%.
-Kwok
jolran, some feedback:
An quick example of how I would rewrite it. I tweak everything I could, like if it was my own plugin. I went back to the old way without having to select a line and changed other stuff. Doesn't matter. The goal is to simplify and compartimentalize. Make it consistant, and easy to follow. Then its easy to modify, later. I include a screen grab. The idea is for you, to do your own version. Also, you can see the indents. The image is too tall to post, so here it is in a zip file:
hatchfaces_rewrite_png.zip
Look at the plugin "Toggle Units": http://forums.sketchucation.com/viewtopic.php?t=11745
Their version is:
state = tb.get_last_state
if(state == TB_NEVER_SHOWN)
tb.show
elsif (state == TB_VISIBLE)
tb.restore
end
But I am not really sure of the use of "restore"? The API saids "used to reposition the toolbar to its previous location". But I tried testing it (moving it and restarting SU, etc..), and don't really see what it is doing. Can anyone explain?
Hi Paul,
I was able to close that last gap, using the Driving Dimensions Plugin: http://drivingdimensions.com/SketchUp/overview/ The plugins lets you modify your model easily by constaining various dimensions (parametric modeling). It's a pay plugin, but also has a free version that lets you place up to 25 dimensions per drawing. The pictures should explain what I did.