Cutlist plugin in reverse?
-
I'm looking for a plugin to do what the cutlist and material plugin does, but in reverse -- take excel spreadsheet information and create components based on those dimensions. I build shipping crates and would like to be able to model them in SU without manually building all the components. Is this possible/difficult?
-
If it's just cubes then it shouldn't be too hard. Do you have some sample data we can look at?
-
attached is a SU file of a sample crate. one crate is shown in an exploded view, the other assembled. the attached excel sheet shows what the cutlist plugin generates from the crate model, and below that is how my excel spreadsheet generates cutlists(This information is on sheet 3). I included the information on the dados that some of the crate panels recieve. I currently use a woodworking plugin that makes dados in components, but if that could be integrated it would be great. I didn't include information on the insides of the crate (inner boxes, foam), as I figured I'd cross that bridge when I get to it.
Let me know if this information makes sense.
-
This is a very interesting topic just because of the fact that when you begin to create dynamic components the second thing you try to do is to automate some processes. I believe SU people will be looking ways to input data (http, files, other local data connectors) to input data to dynamic components.
All I have been able to find out was Oscar's http://forums.sketchucation.com/viewtopic.php?f=180&t=11572 script for excel. I also would like to hear if there is any good ways to approach this problem.
-
@thomthom said:
If it's just cubes then it shouldn't be too hard. Do you have some sample data we can look at?
Can easily do with components as well; I generated a whole model that way last year but from html and JavaScript in a web dialog rather than old-time spreadsheet.
-
Here's the old ruby file, it should help you or someone else to convert a webdialog of data into a display of components and groups.
-
See also this post
-
I believe I worked on your problem earlier this year.
It is simple to read an excel file that has the component name, material, dimensions and even my dado ruby used. These components then are easily inserted into the Sketchup model. BUT!!! (Here is the big question) WHERE DO THEY GO!!
I do not see a simple way to know how to orient these components in space.
Where in the excel file is the orientation of these components in space?
Good luck! I feel your pain.
Joel -
For each piece you really need several extra columns in the worksheet, giving the x/y/z location in the world, the x/y/z rotation in the world and the x/y/z scaling in the world - ideally it should be a 16 item transformation matrix so you can easily set the piece's transformation from it...
tr=object.transformation trans=tr.to_a scalex=Math.sqrt(trans[0]**2+trans[1]**2+trans[2]**2) scaley=Math.sqrt(trans[4]**2+trans[5]**2+trans[6]**2) scalez=Math.sqrt(trans[8]**2+trans[9]**2+trans[10]**2) scale=scalex scale=scaley if scaley>scale scale=scalez if scalez>scale puts " <pos>#{trans[12]} #{trans[13]} #{trans[14]}</pos>\n" puts " <scale>#{scale}</scale>\n" puts " <rotation>\n" puts " <matrix>\n" puts " #{trans[0]/scalex} #{trans[4]/scaley} #{trans[8]/scalez} #{trans[1]/scalex} #{trans[5]/scaley} #{trans[9]/scalez} #{trans[2]/scalex} #{trans[6]/scaley} #{trans[10]/scalez}\n" puts " </matrix>\n" puts " </rotation>\n"
The rotation/scaling are inexorability linked using sines/cosines of the rotation angles in x/y/z etc in a complex but predictable way...
Advertisement