1. Hey guyz. Welcome to the All New Phlatforum!



    Sign Up and take a look around. There are so many awesome new features.

    The Phlatforum is a place we can all hang out and

    have fun sharing our RC adventures!

  2. Dismiss Notice

[Plugin] Push/Pull and Group and Key Rotate Plugin

Discussion in 'Other Sketchup related softwares/plugins' started by kyyu, Feb 10, 2010.

  1. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    This video shows what I am trying to achieve, with writing plugins to simplify the workflow in sketchup. This started with a F15 wood puzzle pdf posted here: http://phlatforum.com/viewtopic.php?f=68&t=1642 My sketchup files are now there, also. I made the parts 1/4" thick and assembled it in 3D. Actually the video was the 2nd time I did it. Only fair, since there was no reference picture. I kind of figured the plugin saved me at least 50% of the time and a whole lot of clicking.

    It would be real mean of me :twisted: if you guys could not do exactly what I did in the video. So at the spur of the moment, I decided to release a beta version of the "Push/Pull and Group" plugin. :cool: There is a video at the bottom, showing how to use it. It's not really ready, as explained in the video, but fully functional. The other rotation plugin, is called "Key Rotate", see below.


    This is just the 1st 10 minutes, because of youtube restrictions. But it shows all, I wanted to show about the workflow. If you want to see the remainder of the drawing, I've uploaded it to media fire (24 minutes and 235 mb). They have a 200mb limit. So I've split it into a self extracting multi part rar archive. You will need both files. Extract the exe from the .zip file and double click it:
    http://www.mediafire.com/?sharekey=9fd8 ... 589d1986ba



    Here is the "Push/Pull and Group Plugin"
    Updated to v1.1 (See the new youtube video below)
    New version adds:
    1)ProgressBar to context menu, which is the major reason for the upgrade. You need the ProgressBar plugin by Todd Burch. If you don't already have it get it from: http://www.smustard.com/script/ProgressBar
    2)added 2nd key (Left Arrow Key) to toggle group or don't group

    Previously updated from beta to v1.0.
    The previous version, adds the feature where you can simply select all the parts and use the right click context. Also, all future plugins will be put in a submenu called [kyyu]. That's for the plugin menu and the context menu. That will make it less messy:

    Copyright(C) 2010, kyyu
    All Rights Reserved
    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.

    Name: Push/Pull & Group
    Version: 1.1
    SU Version: 7.0
    Date: 06-12-2010

    Purpose: This plugin helps with the drawing of 3D models & puzzles for 1/4" sheet stock.

    Description: *1)As Tool: Push/Pull and group(optional), all with one click of the mouse.
    *2)Or Select multiple parts and right click context menu
    ***note: this plugin needs "progressbar.rb" installed ==> return false;">http://www.smustard.com/script/ProgressBar
    Usage:
    # Automatic face picker - just hover mouse over face (I found it useful for selecting faces to delete also)
    # Left mouse button => perform the Push/Pull & Group
    # Right mouse button => toggle group or don't group (check for message on status bar)
    # Left arrow key => also toggles group or don't group
    # Hold down Shift Key => add to selection
    # Hold down Contol Key => reverse the direction of Push/Pull
    # If you change height (default=0.25"), the value is remember for the entire sketchup session.
    # VCB will only except decimal inch values.
    # Can be used from right click context menu, also.

    Credits: 1) I learned alot buy studying TBD's Rotix plugin. Thanks you, for making it!
    2) Thanks to Todd Burch @smustard, for the ProgressBar Plugin!
    History:
    1.0 (05-04-2010) - first version
    1.1 (06-12-2010) - added: context progress bar, 2nd key(left arrow) to toggle (group/don't group)






    Here is the "Key Rotate Plugin" (This was the old rotate plugin without a name, now I've given it a name):

    -Kwok Attached files ky_Key Rotate.rb (4.4 KB)Â ky_PushPull and Group (v1.1).rb (7.5 KB)Â
     
  2. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    This and the rotate plugin are really cool Kwok.
    I'm loving these time saver plugins.
    It would be nice if the VCB was able to determine between mm or inches though. Not that big of a deal to just convert the mm to inches decimal though.

    Question for ya is do you plan to un encrypt the plugins for final releases? I went to look at the code on you 3 released plugins to realize I couldn't lol.

    I think a Ruby section in the forum is a good idea.
     
  3. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    I'm all for a Ruby section! I hoping some more people will show interest. Guess it's the question of the chicken or the egg. That is are there no interest because there is no forum. This video would be perfect for a Ruby Forum. I wasn't sure if I should put it in this section, but no place else for it, right now. If a Ruby Forum is created, I would be willing to make some video & tutorial, explaining how I setup to write and test the plugins.

    I don't understand why the VCB doesn't have a class where all those features included. Unless, I am wrong about it. Would be nice, but I have to write the logic before we will have those features.

    Yes, I plan for the released plugins to be not encrypted, like the "RepairBL and Phlatten" plugin. That's so we can learn from each other. The main reason, I encrypt these two, is so you guys can use them even thought they are not ready for release. They need to be cleaned up and credits added at the top. If I was a programmer, I would have a plan, but I am just making it up as I go. I guess there is no reason why a Beta can't be an official release. OK, I will will clean it up and release it unencrypted.

    You are going to laugh at what I did in the Reorder Groups plugins. I could not do it the logical way, so I noticed something and cheated! :lol:

    -Kwok
     
  4. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Ok, the non encrypted version is now up on the 1st post. DL the Rotix plugin, if you want to compare the changes, I made to the picker logic. http://www.crai.archi.fr/rubylibrarydepot/ruby/rotix.rb It's much more complicated. It might even be a dis-service to show you my picker, because it will be really hard to figure out.

    I won't bother with re-releasing my other two encrypted plugins. 1)The rotating one was done very early, so basically very close to the Rotix group picker and basically the same rotation methods.
    2) The reorder groups is also just a group picker. The secret is I had most of it figure out to save all the group entities to a matrix and regroup, but I couldn't figure out the syntax of the loop. But that was a good thing, because I figure out if you do a "undo" then the group ID is reassigned. So that it for the guts of the plugin, two lines. Just explode and undo. :p

    -Kwok
     
  5. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Tell you what, I will release a screen grab of the other 2 encrypted plugins. I know you still want to see them. That way I don't have to do much:


    [​IMG]


    [​IMG] Attached files [​IMG] [​IMG]
     
  6. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    Cool thanks Kwok.
    I'm really wanting to understand this Ruby language more. I've read a little on it but have a long way to go.
     
  7. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Very cool Kwok!
    I am going to try this on a parts layout and see what happens with it if all the parts are worked with the Phlatscript.
    I think it would be cool to take the part layout or even a dxf patter that you have phlattened and push pull them all at once with one selection, which also will copy all the parts selected and moved to the side. it would group all of them so that you could easily grab them and build the 3d model.
    But really I build the model first so it would be reversed for me. I would like to see the ability to take a model who's parts are made of components, like the ones we make and once they are selected the plugin could be applied and it would copy all the components and rotate and lay them all flat like a part layout ready to be worked with the Phlatscript.
    I think this could be done maybe by comparing the orientation of the component part to a face that the plugin creates on the zero plane? and tries to match by rotating it and phlatten it then re-making it into a component for easy layout.
    Not sure if this is even possible but it seems that all your plugins so far are leading there. what do you think?
    Mark
     
  8. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Mark,

    I understand the 2nd bit, 3D model to 2d parts, layed out on the ground plane. Yea, I am leading up to that. Because since I made the slice form bulb, I've wanted to write my own slicer. The current slicer plugin actually, does do that, lay the part out. So I could look at it's code, as an example.

    The 1st bit, it does most of that already. I will keep what you want in mind, but the problem is that the more automated a plugin does, the less flexible it is. If it did what you said, then you can't just use it for messing with a few part you don't intend to make plans for. You would need two separate plugins that did basically the same thing or really complicate the logic, so you can choose different modes. Right now it does group all the parts after pushpull. So to do what you want, you just need to make a copy of your 2d parts, which is real easy. Also, another problem is the parts you want to use for 3D, needs all the inside opening's faces deleted. So I still need to see if, I can write a plugin to do that. Selecting everything with a box is one feature I want to add. What I plan to do is use the built in sketchup selector to do the box selection, then a right click context menu to run the "PushPull & Group" plugin (no longer a tool when called this way). The good thing is this doesn't complicate the tool portion of the plugin. And if I get these two things to work, then the workflow would be. Select with box, control key to make copy, place the copy to the side, right click, choose function from context menu and it's done. Unless I don't understand correctly what you want?

    -Kwok
     
  9. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Really just like you said the slicer does except after you were done creating the model made up of components or groups like the components are on most of the phlat models we make.
    It would be cool to be able to just select all of them and hit the plug in and it would make copies of the selections and lay them out flat no matter how they were positioned in the model they came from.
    That way you could just lay them out from there and work them into a cut file.
    unless you know of a way to create a part nesting in the safe cutting area as well :D
    That would be insane for sure
    Mark
     
  10. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    I'll put it on the wish list. Normally, I put it on the back of my mind. And when I run into a solution, that how plugins are born! -Kwok :D
     
  11. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    I understand that, for sure :)
    Just thought I would put it out there because it seems like you are really close to making something like that now
    Mark
     
  12. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    I've just posted updated version of the "PushPull & Group" plugin and the "Key Rotate" plugin. Check the bottom of the 1st post.

    -Kwok
     
  13. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Thank you Kwok downloading them now :) This is nice that they are all in their own context sub menu.
    Mark
     
  14. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Hi Mark :) , yes it actually took some work to get that submenu working. That's becasue only each seperate plugin will try to load an extra submenu, hence the few extra lines of code to prevent that.

    Opps, I made a mistake and forgot to add two words in the description of the "Key Rotate" plugin. That is "90 deg", which I think is kind of important to understand it's function. So I've updated it from v1.00 to 1.01. I see 4 people have downloaded v1.00. It's not big deal, but if you would like those two words then by all means download the new version I just posted. ;)

    -Kwok
     
  15. kram242

    kram242 Administrator Staff Member

    Offline
    Messages:
    6,311
    Trophy Points:
    13
    Location:
    NJ
    Nice job Kwok!
    Thank you for the update :)
     
  16. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Sorry about this, but I had to update "Key Rotate" to again to v 1.02 :oops: . Again no change in the code. Just needed to add, "Hold down the shift key to add to selection" in the description.
     
  17. xtremeRCpilot

    xtremeRCpilot Member

    Offline
    Messages:
    736
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    Kwok, dumb question, but with your Push pull group plug in how do I set the thickness?

    Thank you
    John :)
     
  18. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    I added some more info to the 1st post. Basically you just type it into the VCB box, like normal, and press enter. But it only has the most basic functions. Only accepts decimal inch values and you need a zero before the decimal point, if less than 1 inch. It will remember the value for the entire SU session.

    btw, if you use the "Pocket Tool" plugin, you might want to check this out. I fixed something in it: viewtopic.php?f=103&t=2000#p20015

    -Kwok
     
  19. xtremeRCpilot

    xtremeRCpilot Member

    Offline
    Messages:
    736
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    Awesome, Thank you Kwok!! I just set up a few shortcuts and tried it out, This is fantastic !!! Do you use have a shortcut for the Slots 4 Tabs.rb!! I couldnt find it in the preference under shortcuts :) :cool:


    John
     
  20. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    You're welcome, John. I use alt-s for Slots 4 Tabs. Even got explode set up on shift-a. Try tracking that one down. :cool: The thing you got to remember about context menus; is they are different or doesn't even exist depending on context. If you right click on the screen and no menu shows up, then when you go to preferences/shortcuts; as far as sketchup is concern it doesn't exist. So draw something, right click it and make sure you can see the context menu of the plugin. Make sure to leave the part selected and then you will find it in preferences/shortcuts. ;) -Kwok
     
  21. xtremeRCpilot

    xtremeRCpilot Member

    Offline
    Messages:
    736
    Trophy Points:
    16
    Location:
    Cleveland, Ohio
    Once again, that worked perfect!! Thank you Kind Sir!!!! I am having Fun again!!! :D
    I forgot we could use the shift+ for alternative shortcuts!!! :cool:


    Thank you!
    John
     
  22. TigerPilot

    TigerPilot Well-Known Member

    Offline
    Messages:
    1,578
    Trophy Points:
    48

    I use shift+e. I find it more intuitive. Explode, you know? :D I use the shift+a for 'unhide all'. A
    ll, you know? :D
     
  23. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    I'm just a rebel. :p Down with the establishment!
     
  24. kyyu

    kyyu Active Member

    Offline
    Messages:
    1,183
    Trophy Points:
    36
    Location:
    Maryland
    Hello, The "Push/Pull and Group Plugin" is updated to version 1.1

    The major change is the addition of the ProgressBar to context menu part of the plugin. Minor change is added 2nd key (Left Arrow Key) to toggle group or don't group. I've never made a proper video for this plugin, so check out the new youtube video. It goes over basic and new stuff.

    -Kwok
     
  25. 3DMON

    3DMON Moderator Staff Member

    Offline
    Messages:
    2,380
    Trophy Points:
    38
    Location:
    Sebastian, Florida
    The progress bar is a nice touch. Thanks for the update!
     

Share This Page