[Woodworking] Yet another CutList plugin

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.

I’ll have a look.

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.

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.

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.

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: ?

I think so.

Not sure. I’m no Ruby wiz.

Escape the nested quotes
"#{path}"

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”)

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…

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

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

@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 )

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 ?

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:\.

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.

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

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).

Wow, thank you Jim !

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…