View parts looked promising, but it opened every single part in a new tab. What I really want is to actually have a plugin the places lots of parts side by side so that they can easily be seen and then labelled for cutting without using something like cutlist.
I’m sorry to bring this object back to the forums, I have left it several months because it wasn’t practical to think about during the winter.
You might try the layout function of the CutList extension. It lays out the parts of a model onto a collection of sheets or boards that you specify. To get exactly what you show you would have to edit the output a bit, but at least all the boards are laid out flat on the x,y plane and organized by material and thickness.
The trouble is, it does not show the posts which have specific cuts in them and the sheet metal, which needs to be cut a specific way. Nor does it show the shape of the boards which are a specific shape.
If there is no realistic way to do this in bulk (UGH), is there an easy way to set a specific distance between highlighted components on the horizontal plane and also twist so that their side is shown rather than their top?
All the tutorials I searched through deal with spacing only of new copies of an object, please tell me that there is a way to do this with a selection of existing objects.
Also, how can multiple objects be rotated 180 degrees to show another face? If I tried to do this now, I would have to rotate by 180 degrees but then they would all be stacked, not shown as they are in the example.
Thanks for the suggestion. It definitely does the spacing thing as I described. I haven’t been able to get it to rotate the selection on the plane I want though, it keeps spinning them around long ways.
I use this software for my own projects, not for business. There are a lot of tools out there which are free but people have put a lot of time and thought into, I don’t see what makes this extension so special compared to the others, which in many cases, provide suites of tools far more powerful.
How would you move the objects previously pictured so that they are evenly spaced (remembering that we are talking about spacing existing components, not new/copy arrays)?
Also, can you think of a way of rotating multiple components so that they turn to a different face rather than end up stacking?
I don’t mean to sound this way, but you have what, sixteen components in this model?
In the time you’ve spent posting back and forth, you could have easily done this as Dave R said with the native tools.
Unless you are looking for a solution for a future project with hundreds of parts, I don’t see your problem.
In the past, I’ve used another program called “Cutlist” (not the one germane to SU), and it took hours to punch in all the parts. It required you to enter all the sheet goods and dimensional lumber you had in stock, orient the way you wanted things cut, set the waste, the kerf size…
Here is some quick and dirty code that will do most of the work. Some of the longer pieces get flipped the wrong way but you should be able to clean that up easily.
mod = Sketchup.active_model
ent = mod.active_entities
sel = mod.selection
SKETCHUP_CONSOLE.clear
org = Geom::Point3d.new()
cis = ent.grep(Sketchup::ComponentInstance).each{|ci|
ci.transform! ci.transformation.inverse
vec = org-ci.transformation.origin; #p vec
ci.transform! Geom::Transformation.new(vec) if vec.length>0
if ci.bounds.width>ci.bounds.height
vec = org-ci.bounds.corner(2)
ci.transform! Geom::Transformation.new(vec)
ci.transform! Geom::Transformation.rotation(org,Z_AXIS,90.degrees)
end
if ci.bounds.depth>ci.bounds.width && ci.bounds.depth>ci.bounds.height
ci.transform! Geom::Transformation.rotation(org,X_AXIS,90.degrees)
end
org.offset!([ci.bounds.width+1,0,0])
}
Wow, this looks epic. I haven’t been able to try it yet and just wanted to say thanks in the mean time.
Just a thought, if you can code to meet the basic requirements, are you able to tweak the code to add a specific gap between parts? Like 10cm or something?
Answer:
mod = Sketchup.active_model
ent = mod.active_entities
sel = mod.selection
SKETCHUP_CONSOLE.clear
org = Geom::Point3d.new()
cis = ent.grep(Sketchup::ComponentInstance).each{|ci|
ci.transform! ci.transformation.inverse
vec = org-ci.transformation.origin; #p vec
ci.transform! Geom::Transformation.new(vec) if vec.length>0
if ci.bounds.width>ci.bounds.height
vec = org-ci.bounds.corner(2)
ci.transform! Geom::Transformation.new(vec)
ci.transform! Geom::Transformation.rotation(org,Z_AXIS,90.degrees)
end
if ci.bounds.depth>ci.bounds.width && ci.bounds.depth>ci.bounds.height
ci.transform! Geom::Transformation.rotation(org,X_AXIS,90.degrees)
end
org.offset!([ci.bounds.width+10.cm,0,0])
}
Revision by mitch (more comprehensive approach):
mod = Sketchup.active_model
ent = mod.active_entities
sel = mod.selection
SKETCHUP_CONSOLE.clear
org = Geom::Point3d.new(); spc = 10.cm
cdn = ent.grep(Sketchup::ComponentInstance).map{|ci|ci.definition.name}.uniq.sort
cdn.each{|n|
cis = ent.grep(Sketchup::ComponentInstance).each{|ci|
next unless ci.definition.name==n
ci.transform! ci.transformation.inverse
ci.transform! Geom::Transformation.translation(org-ci.transformation.origin)
if ci.bounds.width>ci.bounds.height
ci.transform! Geom::Transformation.translation(org-ci.bounds.corner(2))
ci.transform! Geom::Transformation.rotation(org,Z_AXIS,90.degrees)
end
if ci.bounds.depth>ci.bounds.width && ci.bounds.depth>ci.bounds.height
ci.transform! Geom::Transformation.rotation(org,X_AXIS,90.degrees)
end
if ci.bounds.min.y < org.y
ci.transform! Geom::Transformation.rotation(org,X_AXIS,180.degrees)
ci.transform! Geom::Transformation.translation(org-ci.bounds.corner(0))
end
org.offset!([ci.bounds.width+spc,0,0])
}
}