Hello,
I have been using the build box extension from JimHami42 that creates a box from a csv comma separated file. I would like to expand on it and add an attribute automatically (the name) in entity info. the text would come in from three different values sorted previously in an excel file. Would anybody know where to begin with this?
What version of SketchUp are you using? Your profile indicates SketchUp Free (Web) 2015 which doesn’t exist. The correct information will help us help you.
No the DC “Name” attribute will not be reflected in the Component “Name” property that you see displayed in the Entity Info inspector.
You will need to solve this using the SketchUp Ruby API.
To use it, you should first learn the basics of Ruby (as SketchUp’s API only extends the Ruby language.)
So, please edit this topic title, and reassign the topic to the Ruby API subcategory.
Hello Jim,
Thank you for replying to this thread, I have been using your plugin jimhami42_import_boxes.rbz extensively to import shapes from an excel list. In an effort to streamline my process I would like to figure out how to add some attributes to the box creation if possible.
Jim, this works perfectly, thank you for taking the time to do this.
Would you be able to send me a private message as I would like to develop the extension further?
Can you provide a sample of the what you need? Do these need to be spread out? In an array? I’m not clear on what you’e trying to accomplish … a picture might help.
Hi, sorry to jump into this after a year. I see that this topic suddenly ended and was curious about the last question.
I’m just trying the extension and had basically the same question. How to create a csv where the different blocks are separated in sketchup? Now they appear all on top of each other.
One other question: for example box,20,10,10
this will create a height of 20 , width of 10 and length of 10. However my sketchup is set in meters and for some reason it converts the data also to meters where I basically want to have a box of 20m x 10m x 10m. My box appears as H=0.51m W=0.25m L=0.25m.
Why is this happening?
If the extension code reads the input and runs it through the String#to_l, then if your CSV fields include the unit, ie "20m" instead of "20" (defaulting to inches), then you should get properly sized objects.
The CSV file would also need to supply X, Y and Z fields for the origin coordinates of the box. Then the code would need to also need to read those values and use them to position the box (either whilst it draws or as a translational transform to apply to the box group afterward.)
Thank you Dan for your quick reply always.
I have added the units as you mentioned, but that does not make any difference when importing the csv file.
example: my csv file read just 1 line
BOX1,10m,5m,4m
I still get a box of 0.25m x 0.13m x 0.10m
Somehow this did not do the trick and stays in inches.
Could you add a csv file with 2 boxes separated in sketchup (incl x,y,z fields)?
As a note, @DanRathbun outlines the correct way to fix this, but I hard-coded it as inches to meters since I had trouble with getting the String#to_l to work. This plugin will show up as “Import Boxes 2” on the extension menu. jimhami42_import_boxes_2.rbz (628 Bytes)