@jolran said:
Nice icons Kyyu! Very useful plugin.
Thanks, my 1st icons. I think the most time was spent, just making the icons.
@jolran said:
Nice icons Kyyu! Very useful plugin.
Thanks, my 1st icons. I think the most time was spent, just making the icons.
@unknownuser said:
The last update 1.2 works like expected. It was a bit confusing for me when the menu item was doing something different than what the toolbar was doing.
By what it looks, basically what the plugin does is change the scale properties for each component, right?
Yes, the user is selecting or processing all components/groups. And I explained, in basically the 2nd sentence of the 1st post that a property of the comp/group was being modified. I get confused myself about other peoples plugins. It's just the nature of things, the wild west of plugins.
@unknownuser said:
I think some people may confuse this tool as being a separate scale tool that scales only in the XYZ direction...
but it is actually a tweak for each component to scale differently, with the original scale tool. I guess it is similar to using dynamic component scale attributes (as in the image attached)would this tweak have any effect on model performance? or file sizes!? When I was using dynamic component attributes for this exact same scaling idea, it used to make overall sketchup performance a bit laggy at times.
The properties in that picture look very familiar: http://code.google.com/apis/sketchup/docs/ourdoc/behavior.html#no_scale_mask=
I am using those exact properties, from the SU ruby api. So maybe you will get the same limitations? Big models is kinda outside my knowledge zone. I'm still using an old computer, Pentium 4, but it's enough for my need. Just do small home project with SU.
@unknownuser said:
- Is it at all possible to have a separate scale tool that would do just this, without the need to change properties of each or all of the components, a tool that would work on simple un-grouped geometry as well?
Of course, anything is possible, but would you spend the time to do it? Probably not, usless it was very important to you. Even this small pugin, I probably spent an evenings time spread over a few days. And I'm no expert, just slowly learning.
But I see that Fredo6 just put a similar, but real tool mod in his FredoScale plugin. Looks like he is responding to the same request I saw. I just happen to come across a solution and remembered the request. Check it out:
http://forums.sketchucation.com/viewtopic.php?f=323&t=17948&start=600#p343978
@unknownuser said:
In the latest version 1.2, there is a problem that the simple scale isn't constrained to only X Y Z, but also one more XY... see attached image.
I used the toolbar to change the properties...
Yes, I have X,Y,Y and (X+Y). The request was for scaling sheet parts. So X+Y coupling is fine and probably wanted. I just removed all z coupling. If you want, just X,Y,Z; it's easy enough to change:
Line#56 where it has "e.behavior.no_scale_mask=88" just change the "88" to "120".
Updated to v1.2, see 1st post. The menu item has always processed the selection, if it exsit. Now the toolbar icons do this, too. But there is an option to change it back to only processing all. See the description. Also, I darkened the icons.
manhaaa, I would start with Chris Fullmer's youtube vidoes: http://www.youtube.com/user/ChrisFullmer#g/u
Look at the Sketchup Ruby API: http://code.google.com/apis/sketchup/docs/index.html
And find some very simply plugins and study them.
@rv1974 said:
Hi Kyyu!
Could you please make a simple version of the script without any icons and dropdown options?
Just a distillated simple scale ruby. Please!
Thank you!
You really want a one way ruby? copy/paste into ruby console or .rb file.
UI.menu("Plugins").add_item("simple scale handles"){Sketchup.active_model.definitions.each{|e|e.behavior.no_scale_mask=88}}
@unknownuser said:
@kyyu said:
@unknownuser said:
Description: This plugin makes it easier to use the scale tool, on thin sheet parts. When the scale tool is used on a modified component/group, the drag handles are reduces from the normal 26 to only 10. Tested on SU8, and also seems to work with SU7.
From Plugins Menu: If nothing is selected, than all active groups/components are processed. Run from the Plugins menu: "[ky] Simple Scale Handles"
Nice plugin!
Though it doesn't work for me as described. If I select one component, and run the tool, it still effects all of the components, except for components that are within components. No matter what I select, it always effects everything.
From the plugin menu? I just double check and it works the way it should. From the toolbar icon, it's supposed to only processes everything (if you look at the next paragraph in the description). The idea was that a depressed icon would indicate, you had processed everything. Although, I could probably set it up so the toolbar can be used with selection and only depress whatever was last all processed. You can still click the icon, when it is depressed. Is that the way people would like to have it set up?
On your last picture, "rotation", the move tool will easily rotate a group/component about the 3 axis. There are plugins, goggle the "Ruby Depot". I've found rotation plugins there. And for the diagnal line, the native rotate tool will align to the axis if you click drag along the axis. Both let you enter an angle in the VCB.
I added a toolbar. 1st post updated to version 1.1
@jolran said:
Hmm I will try..
Where do you learn all these commands?? It feels like I'm missing some information source(exept from this forum).
You have to learn the ruby language itself. I'm lacking in this area, too.
@thomthom said:
Might want to wrap that up on a start/commit operation so it can be undone in one go.
I had the start/commit operation in there originally, but no undo was created? So I removed it. Any other benifit of having it in there?
@krisidious said:
are you saying this flattens stuff?
No, it changes the apperance of the skechup native scale tool. The right part in the image shows the change.
I've made a plugin and posted here:
http://forums.sketchucation.com/viewtopic.php?f=323&t=38888
By request, a plugin to make it easier to use the scale tool, on thin sheet parts. Component/group definitions have a property that hides the handles. When the scale tool is used on a modified component/group, the drag handles are reduces from the normal 26 to only 10.
Newest is version 1.2
v1.0 (7-21-2011) initial version
v1.1 (7-23-2011) added Toolbar
v1.2 (7-25-2011) Toolbar now processes selection, with option to only process all.
@unknownuser said:
Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided this notice appears in any copies.
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Author: kyyu (7-25-2011) v1.2
Description: This plugin makes it easier to use the scale tool, on thin sheet parts. When the scale tool is used on a modified component/group, the drag handles are reduces from the normal 26 to only 10. Tested on SU8, and also seems to work with SU7.
Activated from (Plugins menu "[ky] Simple Scale Handles") or (Toolbar). If nothing is selected, than all active groups/components are processed. Toolbar icons are depressed, as a visual indicator when all comp/groups are proccessed. Depressed icons can still be clicked, for example to process a selection. There is an option below, for the toolbar to ignore selection.
Options: There are 3 vaiables at the beginning of the script, whos value can be changed to customize the plugin.
[menu = true] -load "Plugins Menu item"
[toolbar = true] -load Toolbar
[@toolbar_all = false] -if true, Toolbar will ignore selection, and only process all active comp/groups.Tip: You need to have the z axis, of group/component, aligned with the thickness of the sheet.
It seems you can set the properties of hiding the scale tool handles, in the component definition itself. Try scaling these parts. Is that what you had in mind?
Jim,
Good point. I knew of variables being a reference to an object, but still confusing at times.
@kyyu said:
@jolran said:
Or do the arguments in the definition heading like TIG said
def hatch(angle,spacing,gents)Hehum.. I'm to new to this.
I do it the way TIG is suggesting, passing arguments. I make instance varibles only when I really need to. I'm not saying I know the best way, but here is an example from a recent plugin of mine. Notice I have a @scale instance variable, but also a scale variable that's local to the scale method. What I'm doing in this paticular case is scaling back down. So I use "1/@scale", when calling the method. Also the method can't accicently change the instance variable, it's all local. Just to be clear, I'm not saying make instance variable and pass them to the method. It just happened that's the way I had it in that plugin. I think it was because, I had an initialize method at the begining and I wanted those values available to the main program method. So I made them class and instance variables.
def main
> ...stuff
> scale(@@ent.to_a, (1/@scale.to_f))
> ...more stuff
> end
>
> def scale(ent, scale)
> tr = Geom;;Transformation.new(scale)
> Sketchup.active_model.active_entities.transform_entities(tr,ent)
> end
Ok, that was a strange example. How about this one, more applicable to your case.
def main
@spacing1=20.to_l if not @spacing1
@spacing2=20.to_l if not @spacing2
...some stuff
scale(ent, @spacing1)
scale(ent, @spacing2)
...more stuff
end
def scale(ent, scale)
tr = Geom;;Transformation.new(scale)
Sketchup.active_model.active_entities.transform_entities(tr,ent)
end
@jolran said:
Or do the arguments in the definition heading like TIG said
def hatch(angle,spacing,gents)Hehum.. I'm to new to this.
I do it the way TIG is suggesting, passing arguments. I make instance varibles only when I really need to. I'm not saying I know the best way, but here is an example from a recent plugin of mine. Notice I have a @scale instance variable, but also a scale variable that's local to the scale method. What I'm doing in this paticular case is scaling back down. So I use "1/@scale", when calling the method. Also the method can't accicently change the instance variable, it's all local. Just to be clear, I'm not saying make instance variable and pass them to the method. It just happened that's the way I had it in that plugin. I think it was because, I had an initialize method at the begining and I wanted those values available to the main program method. So I made them class and instance variables.
def main
...stuff
scale(@@ent.to_a, (1/@scale.to_f))
...more stuff
end
def scale(ent, scale)
tr = Geom;;Transformation.new(scale)
Sketchup.active_model.active_entities.transform_entities(tr,ent)
end
@sergey2402 said:
@kyyu said:
If you want to use the profile edge style.
Have I understood you correctly?
Yes, just hide or apply a transparent material to all the many small faces in the hatch group. Very easy to do with ruby.
@jolran said:
@unknownuser said:
Is that duplicate line needed at line# 136 ?
No
Thank you for spotting that Sometimes I get wierd results when I copy from ruby code editor and paste to Notepad ++.
Did not doublecheck the results well enough.
Note. It is AS ruby code editor, not Jims version. Is Jims more stable? I think it's a webdialogthingy-bug.Thank you for keeping on testing stuff! It's of big help. How about a choice of keeping faces? With possibility to attach
material? That way one could use transparent material or whatever? Wonder if it is possible to use a dropdownlist getting the materials already added in the palette...Anyway, must get this second crosshatching inputbox working correctly first, and do some fancy methoding.
I don't have any problems with copy/paste from Jim's Ruby Web Console (older one, not his newer one).
It's up to you about the features, keeping faces, or materials, ..etc. I don't have any preference as, I don't need to hatch stuff.
-Kwok
If you want to use the profile edge style. I was thinking you could keep the hatch faces and give them a transparent material. That worked. But then I thought, it's even simpler is just to hide them. I was worried that "unhide all" would unhide the faces, but it doesn't seem to effect the grouped faces.