Thanks! I'll try that.
Posts
-
Keycode with onKeyUp question
I'm trying to use the arrowkeys to move an object in a ruby script.
I've found the onKeyUp info in the docs but my initial question is what keycode the arrow keys have?
While googling IΒ΄ve found both: 103, 105, 106, 108 and 200, 203, 205, 208. Which is it?
Or can I use up, left, right, down or uparrow, leftarrow, rightarrow, downarrow?
Thanks in advance! -
RE: Align points
Thanks Azuby, I didnt know that. But I am a noob on Ruby.
I've never seen it in the ruby docs though. Since I've seen both @ and $ used, I assumed you could use either.
In my noobiness I though the @ came from @-atlast.Rick W, thanks I tried it but it still doesnt work. Could you please take a look at my script to see where I go wrong?
Maybe try my script with a rectangle and set Align to custom and some custom value.
-
Align points
Hi all!
I'm trying to make a align script for points. I think it could be useful to correct none planar lines and more...
It works fine for lines but with faces it makes them triangulated (by autofold) since it moves each point individually.
Since I'm a noob to ruby I now need help figuring out how to auto delete all the edges created by autofold.Here's what I've tried. But doesn't work:
class AutofoldWatch < Sketchup;;EntitiesObserver def onElementAdded(element) autofoldEdges = []; ### Gather all new edges in an array if element.typename == "Edge" and element.valid? autofoldEdges.push(element) end#if return autofoldEdges; end#def end
And just before the action happens:
Sketchup.active_model.entities.add_observer(AutofoldWatch.new) ###Observer added
And last in the script I'm trying to remove the new edges in the "autofoldEdges" array:
autofoldEdges.erase! ###Erase edges created by autofold Sketchup.active_model.entities.remove_observer AutofoldWatch ###Observer removed
-
RE: Working with selection - ungrouped or within a group
I'll try to explain what I'm after.
Is it possible to make a script work with either the edges/faces in a selected group or the ungrouped edges/faces if there is no group?
I don't mean at the same time, but to recoginize if the selection is a group or not and be able to work either way.If not, I guess I'll have to make two scripts, one for groups and one without.
-
Working with selection - ungrouped or within a group
(Posted this at the SketchUp forum but since its dissapearing I'd thought I'd post it here also)
If I want a script to work with a selection of either ungrouped objects or within a group.
Could something like this work?if selection.typename == "Group" { entities=group.entities }
else { entities=model.active_entities } -
RE: Adding Interactive SketchUp Models to PowerPoint Presention
I have tried it repeatedly but it keeps loading the applet forever...?
-
RE: So what do you think about the SCF?
Coen, I like it better with the avatar and personal info to the left.
We read from left to right and I believe its better to see who has posted before reading the post. IMHO. -
RE: My ruby's
Two more scripts added.
JS Shadow Threshold
Set the threshold for when a transparent object will cast shadows.
Works on either entire model or a selection.JS Shadow Control
Set if a selection should cast or receive shadows.Get them at my site: http://www.pixero.com
Enjoy!
Jan
-
RE: My ruby's
Just a thought... are you extruding in a direction that is possible?
(I mean not in 90 degrees from the surface normal.)
And of cause you'll have to click ok.
Other than that I dont know. Are you on Mac or Windows?And Coen, I want people to come to my site to download.
-
RE: My ruby's
I've updated JS Align so it works with groups/components as well.
If using custom value with groups, also use the Align groups: Max, Min or Center.Enjoy!
-
My ruby's
Here are three ruby scripts that I've written. Thanks to those who have helped me learn.
JS MoveTool
Description: Moves a selection with the arrow keys.
Usage:- Select a object or group of objects.
- Select the JS MoveTool and enter a distance in the VCB. Press Return/Enter.
- Now move with arrow keys.
- Use Alt + Up/Down to move in Z axis.
- You can enter a new distance at any time.
Hopefully it will work on both Windows and OSX.
Assign it to a shortcut hot key. For example Alt+M.JS Extrude (based on the Push Pull Z script by Didier Bur)
Description : Extrudes a face/faces along either X, Y or Z axis or the normal direction.
Usage : Select a face, select JS Extrude from the Plugins menu, choose direction, enter distance and here you go.JS Align
Description: Use for aligning/flattening edges.
Issues:- If used on faces they will be triagulated.
Since the script moves each vertice at a time,
SketchUp's autofold feature will trangulate all non planar faces.
I've tried to find a way of auto erasing all edges created by autofold but havens succeded.
If you know how to fix it please let me know. - The script doesnt work well with faces inside groups/components.
Get them at my site: http://www.pixero.com
Enjoy!
-
RE: [Plugin] zoom_selection.rb
I made a zoom selection a while ago. Even simpler.
You can find it under downloads at my site.
http://www.pixero.com