How to make a Solid Component from a Solid Group?
-
@tomot said:
I believe viewtopic.php?f=323&t=23307&start=15
That is TT_Lib version 1 - only used by Selection Toys. And by itself it does nothing.
-
@gaieus said:
This plugin would allow you to convert all instances of the same group definition into instances of a component definition. (I believe).
http://forums.sketchucation.com/viewtopic.php?t=14975csaba,
how does one go about converting groups into components with Selection Toys? I did not find any command (icon or menu item) to do that.
edit: I have just found how to do it: first select the groups then right-click and select Group Copies>Convert into Components.
-
This, of course, only works until you modify any f the group instances (and that group instance will be unique this way). Here it goes (it's in the right click / context menu of a selected group)
-
Some simple code will take ALL selected groups, make a component of the first selected group and replaces all the selected groups with instances of that component...EDIT:
CODE REMOVED AS NEW VERSION IN A LATER POST IS MORE EFFECTIVE...
-
TIG! I made an .rb file out of your code. Yes your script creates what I'm looking for, BUT, why do you erase the component group it just created? I want to leave all the rafters in place so I can edit one of the rafter tails which will influence the other 5.
-
OK.
I doesn't erase the rafters - as Entity Info shows there are 6 - all overlaid...
The issue is that the groups don't seem to be 'equivalent'.
Their 'insertion points' are different, so when they get made into a component the new instances become 'coincident'.
How are you making these groups initially ?
Is there a way of giving them a consistent 'origin' ?
The code I posted only works if all of the groups are 'equivalent'.
Of course in your case you can move the instances back into their correct locations, and then notching one will notch all... -
Why not use the equivalent RafterTool ? http://rhin.crai.archi.fr/rld/plugin_details.php?id=319 it automatically makes components except for the last infill 'group'. It's easy enough to tweak the settings to make mono-pitched rafters... [you made it!]
IF you really have to do this, in this way... then I COULD code something to give every selected rafter-group a consistent 'origin' and then make them into single component instances...Let me know...
-
That brings us full circle, back to my opening thread. The Rafters are created by an (.rbs) ruby, while the joists in yellow are created by JoistTool.rb
There is something else I have noted about this .rbs file, it appears to me that the author mirrored the rafters about a center hence those at the middle are not equally spaced, as shown in the pic and the .skp file.
-
I gather that ss=model.selection is not robust enough to able to register the co-ordinate location of each existing rafter, so that this information can be used again to reinstall the new component group to their original location?
-
@tig said:
Why not use the equivalent RafterTool ? http://rhin.crai.archi.fr/rld/plugin_details.php?id=319
I know that guy! its the other me. LOL! But actually the rafter tool from 10001bit are more practical for most complex roof framing, particularly when it comes to hip and valley framing, unfortunately this human need to preserve ones code gets in the way of going forward ......sigh! -
@tomot said:
I gather that ss=model.selection is not robust enough to able to register the co-ordinate location of each existing rafter, so that this information can be used again to reinstall the new component group to their original location?
It can... so I will code some convoluted transformation stuff for you tomorrow - it's late here right now... -
(c) TIG 2012
Permission to use, copy, modify, and distribute this software for
any purpose and without fee is hereby granted, provided that the above
copyright notice appear in all 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.
TIG-groups2components.rb
Usage: Preselect the 'equivalent' groups to convert.
Type [copy/paste] this into the Ruby Console
TIG.groups2components
This takes the selection of groups and turns them all into
instances of one component that is made from the first group in the
selection. The insertion points of the selected groups is rationalized
so that groups that are effectively the same form [e.g. rafters made
using 1001-tools] but with varying insertion points are accommodated.
Only use it on groups that are either copies of the same group, or
groups that are 'equivalent' in 'form' to each other, because it will
affect all groups selected. Each group's layer and material is
duplicated in the new instance that replaces it.
It is one step undoable in case of disasters !
Donations: Paypal.com = info @ revitrev . org
Version: 1.0 20120208 First proper release.
Place into the Plugins folder and restart Sketchup. Follow the Usage Notes...
-
Well done TIG! the components are indeed editable, except for one small problem, when using a hip roof the rafters are all the same length, the attached file explains further.
-
You can't make a single simple component to serve as a series of different length hipped-rafter groups.
The best you can hope for is to use symmetry and have pairs of mirrored components at opposite ends of the roof...
You couldn't expect to make a component manually that would serve for all the hipped rafters, so how could a simple tool that converts groups to components do any better ?Also if you make a copy of a group and don't edit it then Sketchup can [incorrectly] have two instances of that group's definition. That seems what's happening there...
Here's a version of the tool that makes every group unique before processing it...
try it again and see what happens...
-
I understand the problem! which now takes on a whole new perspective. The solution for editing the rafter tails, of the entire perimeter of a roof the rafters, would appear to lie in producing a secondary set of coincident rafters that only serve as editable tails and that would not interfered with the original rafters at all.
-
How about somehow combining all of the rafter groups that share a common 'wall-plate' into a single group and exploding them inside this 'rafters-group'.
You then [hopefully] have a 'solid' rafters-group.
Then we make another solid group [copy] representing the 'wall-plate' and use the 'Solid' boolean tools to subtract the wall-plate from the rafters' ends, making the required notches in one go, and then we rework the rafters-group contents, so all-connected-geometry was once again made into individual grouped rafters [if that's whats needed] and then explode the temporary rafters-group at the end [if that's whats needed]
What's the workflow here ? -
Actually your roof.rb is a good starting point for an editable rafter tails addition, where the editable rafter tail components only extend from the exterior building envelope to the width of the roof overhang. Is spring in the air yet?
Advertisement