Open Cutlist Extension - Using Ruby Code

Hey folks!

Complete noob at ruby code. Like so new that I just heard the phrase for the first time like 3 days ago.

I work at a custom furniture shop and I’m trying to overhaul our design and pricing process. I’ve opted to use Open Cutlist as a tool to help us quickly generate lots of projects data. We’re currently using spreadsheets to price things and that just doesn’t make sense to me since were drawing it all in the first place. The data is all there already, no need to do extra work!?

Anyway, I don’t know anything about coding in general, I don’t even know if this is considered ‘coding’. My tech friends would probably laugh at me with how simple this probably is. Here’s what I’m trying to do:

I need to find out what the ruby code would be for calculating BDFT price. I know there are ways to make your own custom badges and apply them to the summary but I also want it on the parts list. Can someone help me please?

It seems like there should be an “@price” option in the formulas. This might work but you’d have to change the price variable all of the time:

price = 2
length= @bbox_length
width = @bbox_width
thickness = @bbox_thickness
volume = length * width * thickness

BRFT = volume * 12

BRFT * price

I did have an error with the materials so maybe price does show up when materials are working.

Dynamic Components seem to be able to do it and export it.

do you use dimensional material to get the BDFT?

summary.skp (44.8 KB)

one can add the price in the material-
summary2.skp (60.7 KB)
and get an estimate

I am having trouble getting result to be dollars when I try to use ruby in the summary report

@total_cutting_length is a Length. If you multiply it by a float it stays a length that by default output as its string representation according to the model unit. To transform it into a number, you need to do :

  • @total_cutting_length.to_f (and you get a float in inches)
  • @total_cutting_length.to_feet (and you get a float in feet)

1 Like

@mattstrobel1 what is a BDFT price ?

Solid wood material offers $/FBM unit to set price. Is this what you need ?

And then use it in Estimate.

1 Like

I’m in the parts list, I’m getting what I need in the summary. I probably should have said that first, my bad!

  • I’m trying to get a breakdown of individual part price, & total part price. I’m using the dimensional material because I have plywood, steel tubing & solid wood.

Adding a “price” variable in part list is not possible for Sheet Good or Dimensional parts without computing cutting diagram because multiple prices can be defined on material for specific full sheet size and thickness.

That’s why we add the specific Estimate (formerly Report) module that do this job. But yes it doesn’t display the price of each part.

That was the first time I tried using OCL. Even though I wasn’t familiar with BRFT or the software and had an error pop up about materials, it was easy to use and see just how plain nice OCL is. I also saw some of the options you mentioned above for creating estimates. I’m sure I didn’t pay close attention when I quickly added a material and that’s why I had an error.

I have a couple of projects that will provide opportunities to put OCL to use in the near future. I’m looking forward to getting to know the how to use it better then :slight_smile:

Thanks for your reply.

Do you remember what was this error ?


Currently, it’s not impossible, but it will be a big tweak to compute individual part price in part list export. Because parts list merge all type of material, and I suppose that each type doesn’t have the same “volumic price”.

And as said before, export can’t extract price defined on each material without determining first the raw material size.

1 Like

I quickly re-created it:

I basically followed what was a very easy and intuitive process to create a “Oak” material for a “2x4” component I made in SU (no materials). I selected “dimensional” because that seemed correct.

I was basically trying to test Ruby in the export options. Since I couldn’t quite do it, I started looking at the estimate options looking for an easier way and that’s why I made the material (if I recall, Estimate is not available without materials). It looks like user error since I didn’t fill in any other options.

Ok :slight_smile:

Estimate, run in background the “cutting diagram” feature for each group of part to select the good price. In your case the parts list group Oak / 3 1/2" x 1 1/2".

Cutting diagram uses the standard length you defined in cutting diagram parameters (or the first default one if you never configure anything).

Estimate reuse those parameters.

Then in your case the default standard length is just to small to contains your part.

Standard lengths are configured on the material :

And prices could be set for each section / length

1 Like

*I need to do a site visit to get measurements. The job will be a deck renovation. It should be a simple job and a good test case to get in and use SU and OCL. I’ve not been one to use a lot of (or any) materials in SU. I saw that the material I created in OCL was applied to the component in the model. Because it was easy :slight_smile: and I like the OCL user interface I might be able to improve in the materials department with OCL too.

Anyway, I’ll create proper project and get squared away with materials and sizes… it looks like it’s just a couple of button presses away :).

Thanks for your detailed help! I have reconfigured things in a way that makes more sense for what I’m trying to do. And I’ve learned some ruby code along the way! Much appreciated!

1 Like