Woodworking - getDimensions

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jaisejames
Posts: 384
Joined: Sat Sep 24, 2016 6:51 am

Re: Woodworking - getDimensions

Post by jaisejames »

It will be very nice add ods export[LibreOffice] also using https://odslib3.readthedocs.io/en/latest/.
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

jaisejames wrote: Thu Jun 17, 2021 7:13 am It will be very nice add ods export[LibreOffice] also using https://odslib3.readthedocs.io/en/latest/.

The macro create spreadsheet named "toCut" and than TechDraw Page "toPrint". You can export spreadsheet to csv or save TechDraw page to pdf with formatting. The ods library is supported by FreeCAD by default? looks like it need to be installed first to play with it... However, I will look into it for sure, if I found some time. There is hot weather in Poland right now, I can say... f* hell ;-) so this may take some time I will look into it... ;-) In the past, when there was no TechDraw feature in FreeCAD I was creating LibreOffice page manually, by CSV copy into table. It was little annoying, so the TechDraw make it simpler. May I ask why someone still needs LibreOffice doc? You need extra formatting? maybe there might be option for other formatting?

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Woodworking - getDimensions

Post by M4x »

Looks interesting, I'm going to play with it :)
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

M4x wrote: Mon Jun 21, 2021 7:20 am Looks interesting, I'm going to play with it :)
There is Demo added for debug and testing purposes https://github.com/dprojects/getDimensi ... aster/Demo
I use it when I was coding last features and decided to add it for later use. It covers all the supported elements, there is also correct Tree structure to play with group report, array, element with parent and grand folder and without it, even small elements and 2 colors.

There is also added Thickness option, so you can play with it as well if you use much bigger wood
https://github.com/dprojects/getDimensi ... 5bcf1f0bad

Good Luck, Have Fun!

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

This is almost exactly what I was looking for.
Problem is that my wood sheets are made as Pads in the PartDesign workbench. I do know a little about programming but I am not able to adjust your wonderful script to use Pads instead of Cubes.

Is there any change you could help me towards a solution?
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Petert wrote: Wed Nov 17, 2021 9:50 am This is almost exactly what I was looking for.
Problem is that my wood sheets are made as Pads in the PartDesign workbench. I do know a little about programming but I am not able to adjust your wonderful script to use Pads instead of Cubes.

Is there any change you could help me towards a solution?
Personally, I don't use Sketch and Pads during furniture design. I even don't know how to do it, I prefer simple solutions that works. To calculate dimensions you need to have simple way of finding exact object and calculation, so the Cube is good for that. Some advance constructions are made of many cuts and adds so it is hard to find exact dimensions at the end, I could say impossible in practice of any.

Also I can't imagine what exactly you need to calculate and what type of objects you have. You have any example at github? This script is rather simple, for wood calculation not for advanced objects with not regular shape.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Wed Nov 17, 2021 1:40 pm
Petert wrote: Wed Nov 17, 2021 9:50 am Problem is that my wood sheets are made as Pads in the PartDesign workbench. I do know a little about programming but I am not able to adjust your wonderful script to use Pads instead of Cubes.

Is there any change you could help me towards a solution?
Personally, I don't use Sketch and Pads during furniture design. I even don't know how to do it, I prefer simple solutions that works. To calculate dimensions you need to have simple way of finding exact object and calculation, so the Cube is good for that. Some advance constructions are made of many cuts and adds so it is hard to find exact dimensions at the end, I could say impossible in practice of any.

Also I can't imagine what exactly you need to calculate and what type of objects you have. You have any example at github? This script is rather simple, for wood calculation not for advanced objects with not regular shape.
I design furniture, just like you. But instead of using Cubes and such I want to draw my furniture like a technical drawing, with sketches and such. Everything is parametric and dynamic.
Just a different approach I guess.

I just want the dimensions of the parts my furniture is made up of. I hoped that a Pad would be programmatically the same as a Cube, all straight angles and such.

There is not any usable BOM script for FreeCAD, under Fusion I used OpenBom and that worked great. Now I have to do double work, updating a spreadsheet and the drawing itself.
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Petert wrote: Wed Nov 17, 2021 2:09 pm I just want the dimensions of the parts my furniture is made up of. I hoped that a Pad would be programmatically the same as a Cube, all straight angles and such.
Rather not and I am pretty sure this script will not be working correctly. The script is looking for Cube types, all other are skipped.
However, it is highly possible you can create simple "FOR LOOP" to search for you Pad base parts. I usually use Cube as base but if you use sphere this might be a problem.

Please share some Demo sample with your furniture, I mean the FreeCAD file, or screenshots of FreeCAD Tree folder, in order to see how the furniture is made and what is the folder content and structure. If you want to search you have to know what search and where. So maybe I will give you some advice how to create other macro then.

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
User avatar
Petert
Posts: 124
Joined: Tue Dec 01, 2015 9:27 pm

Re: Woodworking - getDimensions

Post by Petert »

dprojects wrote: Wed Nov 17, 2021 6:57 pm Please share some Demo sample with your furniture, I mean the FreeCAD file, or screenshots of FreeCAD Tree folder, in order to see how the furniture is made and what is the folder content and structure. If you want to search you have to know what search and where. So maybe I will give you some advice how to create other macro then.
Here is one of the designs, hope it is usefull for you.
kastSterre.FCStd
(419.19 KiB) Downloaded 58 times
I am a refugee from Fusion 360. Switched over to FreeCAD and am spreading the word. After years of very little progress I switched again to another solution. I wish you all the best!
User avatar
dprojects
Posts: 721
Joined: Mon Mar 06, 2017 6:02 pm
Location: Poland
Contact:

Re: Woodworking - getDimensions

Post by dprojects »

Petert wrote: Thu Nov 18, 2021 8:34 am Here is one of the designs, hope it is usefull for you.
kastSterre.FCStd
I don't know what is going on there. The Pads (Unnamed objects in folders) have only two properties Length and Length2. The other Unnamed objects have no properties, no dimensions. I have no idea how you create the Spreadsheet table, values and names.

What you want to calculate there exactly?

Thanks
Darek
github.com/dprojects

workbench for woodworking is available at: github.com/dprojects/Woodworking
Post Reply