[Woodworking] Yet another CutList plugin


#1

Hi all,

I’m a Woodworker and I’m please to present you a plugin that I wrote to easily generate Woodworking Cutlist from Sketchup Models.
This plugin is developed around a French woodworkers community platform : L’Air du Bois (https://www.lairdubois.fr) and as the platform it is Open Source and you can access to the source code here :

And download the RBZ extension from here.

This extension is available in French, Englis and German … and it’s free.

You can have a peview of the plugin in this video :

Or a full demonstration in this one (but in french) :

I hope it could be useful for some of you :wink:
Regards.


[Update] L'Air du Bois - Woodworking Toolbox extension
#2

I’ll have a look.


#3

I gave it a quick trial. It looks pretty good. There are a few things I find odd but it could be due to what I’m used to.

I’d rather not see ‘x’ preceding the quantity of components.
Although the exported file is given the CSV extension, it appears to be Tab separated.
It would be nice if the quantity was the first column.
I’m not clear on the reason for raw and final dimension columns since the dimensions are the same. The raw dimensions only seem to appear in the exported file, too.
After exporting and clicking on Open, I get the following message although the CSV file is saved into the directory. It also makes the rest of the screen go black.


#4

Thank you for your feedbacks !

I’d rather not see ‘x’ preceding the quantity of components.

It is mainly here to avoid to confuse it with other kind of value. But maybe you’re right :wink:

Although the exported file is given the CSV extension, it appears to be Tab separated.
It would be nice if the quantity was the first column.

Arf, do you think it’s better to have a TSV extension or use comma instead of tabs. But commas could be present in part names or materials.

I’m not clear on the reason for raw and final dimension columns since the dimensions are the same. The raw dimensions only seem to appear in the exported file, too.

Yes you point a problem. This is because parts of you model has no materiel or their material type are not defined. You need to define the type Solid Wood or Sheet Good in the Materials tab. And then the raw value have sens because is correspond of what you cut.

After exporting and clicking on Open, I get the following message although the CSV file is saved into the directory. It also makes the rest of the screen go black.

Outch, a bug. I think it’s because the directory of your file has spaces.


#5

I think it would be best to make it clear it is a TSV file and not CSV. You’re right about there being commas in part and material names which would screw up the table if it is a CSV file.

Oh.

Can you get around that? It wouldn’t be unusual for directory names to have spaces.


#6

Yes, but, CSV is a more common extension. But you’re right it need to be clear.

Am I clear enough ?

Yes, I think I can. The system call is here. But how to add quote :wink: ?


#7

I think so.

Not sure. I’m no Ruby wiz.


#8

Escape the nested quotes
"#{path}"


#9

Non, the problem is not in Ruby, but in windows command line.
And something like the following does not work.

cmd /c "start “c:\my folder\export.csv”"
cmd /c "start “c:\my folder\export.csv”"
cmd /c (start “c:\my folder\export.csv”)


#10

MAC’s terminal needs / never , but Window’s CMD works fine with / instead of \ - so perhaps use those.

path.tr!("\\", "/")

BUT if you are wanting to open the report, then you can use SketchUp’s own OS independent:

UI.openURL("file:///#{path}")

Which will open the CSV in its default application…


#11

Ho yes for sure, it’s a better solution !! Thank you !


#12

Finaly, it’s not a solution. It doesn’t work on Windows …


#13

@boris.beaulant

I beg to differ.

I have tried it and it works fine.
I often use it !

The reference path must be a full path to an existing file - otherwise it won’t open anything.
Do you get any error messages ?


To show how it works _outside_ of your code, use this in the Ruby Console...

path = "C:/xxxx/xxxxxx/xxx"

where path is a string identifying an existing file.
Check that it exists with:

File.exist?(path)

Returns true if it exists.
Then use:

UI.openURL("file:///#{path}")

The file will open.

It works on any supported OS.
Are you using it exactly as I showed ?
With surrounding “”, the word file and the : then three / and the #{} around the path reference ??
There should be no space between the openURL and opening ( - and don’t forget to close the )


#14

Ok, that’s my fault. the path var lose its \ when it passes through JS.
Your solution works ! Thanks !

But why 3 / in file:/// ? It seems to work with only 2, no ?


#15

The argument is a URL. The file: part says you want to access a file on the local system. The first two // are the base of any URL, e.g. http://. The third / says the base of the path is the root of the filesystem. On Windows, this is equivalent to C:\.


#16

It’s a URL. Similar to https:// The third slash is the start of the path where / means the root drive.

Dang it, Steve.

Also @boris.beaulant, your code is a pleasure to read - thanks.


#17

Ok, then if my path is absolute, I don’t need the third /.


#18

Wrong! You don’t need the third slash if your path is relative. I assume you mean you will include C:, but that is the wrong way to format a URL, use / instead (unless you meant you will include the leading / in the value of path).


#19

Wow, thank you Jim !


#20

Using file:/// works on MAC and PC.
You could reduce the number of / on a PC and it’d still work, but why bother - the /// version is cross-platform safe anyway…