Create Part Library and import it into your project

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Gra79
Posts: 6
Joined: Sun Apr 18, 2021 10:37 am

Create Part Library and import it into your project

Post by Gra79 »

Good morning,
I would like to create a library of a tubular profile and import it into the project and resize it freely.

Code: Select all

OS: Debian GNU/Linux 11 (bullseye) (GNOME/gnome-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.19.2)
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.8
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Italian/Italy (it_IT)

1) I create a .FCStd file
2) I draw a sketch with dimensions relative to the spreadsheet.
3) I use the prism function to create the solid and connect the depth of the part with the spreadsheet.
4) I create a new .FCStd file
at this point how can I import the tubular object and change the size. the import operation has to be done many times and the spreadsheet has different sizes.
For now the solution I have adopted is to open the library file and copy it into the new file in order to recreate the structure and use them as separate elements. Is there a better way? Sorry for the trivial question !!
Thanks
Attachments
Freecad_3.png
Freecad_3.png (118.21 KiB) Viewed 1574 times
Freecad_2.png
Freecad_2.png (80.46 KiB) Viewed 1574 times
Freecad_1.png
Freecad_1.png (89.82 KiB) Viewed 1574 times
User avatar
Roy_043
Veteran
Posts: 8585
Joined: Thu Dec 27, 2018 12:28 pm

Re: Create Part Library and import it into your project

Post by Roy_043 »

Gra79
Posts: 6
Joined: Sun Apr 18, 2021 10:37 am

Re: Create Part Library and import it into your project

Post by Gra79 »

I merged the projects but if I change a measure in the colcolo sheet, all the objects change.
And I need that they are all separate but with the same processing.
Freecad_4.png
Freecad_4.png (68.61 KiB) Viewed 1479 times

Code: Select all

Preferences
The last used file location is stored: Tools → Edit parameters... → BaseApp → Preferences → General → FileOpenSavePath.
Duplicate labels are allowed if Tools → Edit parameters... → BaseApp → Preferences → Document → DuplicateLabels is set to true. This setting can also be changed in the Preferences Editor.
If set to true, the property allows duplication of the label. It does not duplicate the names but goes into error because they are all called the same.
Freecad_5.png
Freecad_5.png (25.85 KiB) Viewed 1479 times
User avatar
Roy_043
Veteran
Posts: 8585
Joined: Thu Dec 27, 2018 12:28 pm

Re: Create Part Library and import it into your project

Post by Roy_043 »

Gra79 wrote: Fri Oct 29, 2021 7:16 am I merged the projects but if I change a measure in the colcolo sheet, all the objects change.
I cannot reproduce that behavior.

There are several cases that I have tried:

DuplicateLabels=False + Labels in expressions + Merge => OK
DuplicateLabels=False + Labels in expressions + Paste => OK
DuplicateLabels=True + Labels in expressions + Merge => Error as indicated in your post (but understandable)
DuplicateLabels=True + Labels in expressions + Paste => OK (the DuplicateLabels preference is not respected which is perhaps a bug?)

DuplicateLabels=False + Names in expressions + Merge => OK
DuplicateLabels=False + Names in expressions + Paste => OK
DuplicateLabels=True + Names in expressions + Merge => OK
DuplicateLabels=True + Names in expressions + Paste => OK

But in no case do I get a situation where a single spreadsheet controls the model.

But maybe my model is too simple. Can you post your file?
Attachments
merge-test-use-spreadsheet-name.FCStd
(12.17 KiB) Downloaded 28 times
merge-test-use-spreadsheet-label.FCStd
(12.17 KiB) Downloaded 22 times
Gra79
Posts: 6
Joined: Sun Apr 18, 2021 10:37 am

Re: Create Part Library and import it into your project

Post by Gra79 »

This file is very simple. It should be used to create a square frame made of tubulars.
I am not attaching the assembler file because it is not working and the tests I described previously have been made.
There are only three bodies imported from this file.
The only solution that works at the moment is to copy and paste the body from one project to another.
But in my opinion it is important to know the right procedure to use more complex bodies.
Attachments
Tubolare_Base.FCStd
(14.04 KiB) Downloaded 28 times
drmacro
Veteran
Posts: 9009
Joined: Sun Mar 02, 2014 4:35 pm

Re: Create Part Library and import it into your project

Post by drmacro »

The concept of "family of parts" has been discussed around FreeCAD many times. I'm not sure there has been a good solution.

There have been similar things grown around fasteners. But, this isn't quite the same.

This topic arises with extruded T-slot profile regularly. Being able to add randomly specified lengths to an assembly is the desire. At first glance this appears to be a perfect fit for parametric CAD. But, it can quickly grow into a complicated process if taken to extremes. For example, how does an update to the profile get propagated to everywhere it has been used (yes, obviously, the answer here situationally dependant...).

Simple implementations have been done where, for a given entry in a table (spreadsheet)
  • a new Part WB object or Part Design Body object is created
  • a new model file is created for each entry in the table
These can then be imported, linked into other files, or even used as components in one of the assembly workbenches.

This doesn't address random lengths since the "family" depends on the values specified in the table (i.e. a row or column has to be specified per family member) and not an on the fly user specified value.
In the past I've seen, in other systems, the ability to simply select faces in a model (or assembly) and a profile to be extruded between, creating a truly ad-hoc length of profile, angle, tube, etc.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
Roy_043
Veteran
Posts: 8585
Joined: Thu Dec 27, 2018 12:28 pm

Re: Create Part Library and import it into your project

Post by Roy_043 »

I just remembered a recent discussion about the same issue. It is indeed a bug.
https://www.forum.freecadweb.org/viewto ... 10#p539783
Post Reply