Designing an enclosure from Assembly 4 elements

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
goutnet
Posts: 13
Joined: Mon Nov 09, 2015 9:07 pm

Designing an enclosure from Assembly 4 elements

Post by goutnet »

Hi,

This post will look a bit like this https://forum.freecadweb.org/viewtopic. ... 5&p=482827 but with some twists…

Here is my situation:

I am creating an assembly (in Assembly 4) based on quite a few external parts. Some parts are fully designed in FreeCAD, while some other parts are importing STEP files.

In the end, the assembly looks pretty OK, but here comes the next part.

I am trying to then design an enclosure (housing) for all those assembled parts, and would like to use features (edges, vertexes etc…) from linked parts into this design.

A classic way to do this on one (non Assembly file) is to use Shape Binders, then design around… but I don't seem to be able to do the same thing (I get an error that says Shape Binder does not support External/Linked parts).

So I tried this:
https://forum.freecadweb.org/viewtopic. ... 5&p=482827

Where several posters suggest to create a Datum_Point from a feature in the linked objects, but it doesn't seem to work either…

Here is what I tried on the later approach:

Say, I have file A that includes file B, C, and D.

1. Open file D, add a datum_point there [works]
2. Go back file A, start a sketch, and try to import point [failed: can't select point]
3. in File A Try to copy Datum point into new body/part (in file A), [failed: it will try to copy linked STEP, and then will still not allow to select point as part of sketch import]

Any help would be *greatly* appreciated at this point ^^;

Thanks a lot!
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Designing an enclosure from Assembly 4 elements

Post by Zolko »

goutnet wrote: Mon Nov 07, 2022 3:17 am A classic way to do this on one (non Assembly file) is to use Shape Binders ... I get an error that says Shape Binder does not support External/Linked parts
SubShapeBinder Image should be able to

1. Open file D, add a datum_point there [works]
2. Go back file A, start a sketch, and try to import point [failed: can't select point]
what do you mean by "import" ?
try the Assembly4 workbench for FreCAD — tutorials here and here
goutnet
Posts: 13
Joined: Mon Nov 09, 2015 9:07 pm

Re: Designing an enclosure from Assembly 4 elements

Post by goutnet »

Hi,

thanks for pointing this tool, it actually works in simple assembly files, but for some reasons it doesn't create a binder on my final assembly :/

I don't get any message either when I try (just nothing happens), might be related to the following warnings I get:

Code: Select all

11:31:03  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
11:31:03  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
11:31:03  46.2489 <App> Document.cpp(2795): Reload partial document battery
11:31:03  46.2563 <App> Document.cpp(2878): Observant_Assembly#battery.LinkedObject: Time stamp changed on link battery#Model
11:31:03  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
11:31:03  AttachEngine3D::calculateAttachedPlacement:InertialCS: inertia tensor has axis of symmetry. Second and third axes of inertia are undefined.
By importing I mean using the "Import Part" button.

I tried selecting the main Model (from Assembly4) as active part (Toggle Active part) or some underneath, and for now I get no message, and no binder on that file :(( The most frustrating is at one point I am certain I was able to create one binder, but not sure how I managed to do it…

What I do is:
1. select the main model as active part (Toggle Active Part) at the root of the tree
2. select a face of an imported model (Import Part)
3. click on the Asm4_shapeBinder button

=> nothing happens, no message, and no binder :(


Maybe related? when i randomly select some of the part, I get this:

Code: Select all

11:43:09  Traceback (most recent call last):
  File "/tmp/.mount_freecaFLElNa/usr/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py", line 348, in addSelection
    prevref = LinkFromStr( self.refLines[i-1].text(), self.obj.Document )
<class 'ReferenceError'>: Cannot access attribute 'Document' of deleted object
11:43:09  Traceback (most recent call last):
  File "/tmp/.mount_freecaFLElNa/usr/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py", line 348, in addSelection
    prevref = LinkFromStr( self.refLines[i-1].text(), self.obj.Document )
<class 'ReferenceError'>: Cannot access attribute 'Document' of deleted object


What is the normal process to create a sub assembly binder
goutnet
Posts: 13
Joined: Mon Nov 09, 2015 9:07 pm

Re: Designing an enclosure from Assembly 4 elements

Post by goutnet »

ok, I was able to fix the error message by re-creating the corresponding file. (not sure what went wrong in the first shot).

I am now able to create a Shape Binder from some parts but not all… still investigating why
goutnet
Posts: 13
Joined: Mon Nov 09, 2015 9:07 pm

Re: Designing an enclosure from Assembly 4 elements

Post by goutnet »

I think I found the issue:

to create a ShapeBinder under Assembly 4, all imported parts must be under the same direct parent…

I was grouping my parts in groups (folders) which removes the ability to create a shapebinder for some reason.

ex:

This works:

Code: Select all

file A:
 + Parts
 + Model
 |- File B::Part B
 |- File C::Part C
that doesn't work, can select B or C to create a shape binder

Code: Select all

file A:
 + Parts
 + Model
 |-+ My_Group
 | |- File B::Part B
 | |- File C::Part C
 
This also doesn't work:

Code: Select all

file A:
 + Parts
 |- File B::Part B
 + Model
 |-+ My_Group
 | |- File C::Part C
 
Creating a binder from B or C will silently fail … (no error, but also no binder)
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Designing an enclosure from Assembly 4 elements

Post by Zolko »

goutnet wrote: Thu Nov 10, 2022 4:45 am Creating a binder from B or C will silently fail … (no error, but also no binder)
no, you can't do that, and there is actually no tool to do such thing. Only B (or C) to A
try the Assembly4 workbench for FreCAD — tutorials here and here
goutnet
Posts: 13
Joined: Mon Nov 09, 2015 9:07 pm

Re: Designing an enclosure from Assembly 4 elements

Post by goutnet »

What I meant is:

While editting file A (and in shape A), trying to create a binder will work or not depending on the structure of A assembly. If creating groups within model A, and trying to create binders from those groups, the binder will fail to create.

So, for now my process is, for a file laid out this way:


1. make sure all parts are under the same direct parent (under Model:)

Code: Select all

File A:
+- Parts
+- Model [root node]
| +- Part A
| | +- Part A::Body A
| +- Part B
| | +- Part B::Body B
| +- Part C
| | +- Part C::Body C
2. Make "Model" the active part
3. Select PartB::Body B
4. Create a binder from there (binder will end up under the parent node directly):

Code: Select all

File A:
+- Parts
+- Model [root node]
| +- Part A
| | +- Part A::Body A
| +- Part B
| | +- Part B::Body B
| +- Part C
| | +- Part C::Body C
| +- ShapeBinder001
5. move the binder manually to Part B (drag&drop from Model to Part B)

Code: Select all

File A:
+- Parts
+- Model [root node]
| +- Part A
| | +- Part A::Body A
| +- Part B
| | +- Part B::Body B
| | +- ShapeBinder001
| +- Part C
| | +- Part C::Body C
6. move the binder manually to Part B::Body B (drag&drop from Part B to Part B::Body B)

Code: Select all

File A:
+- Parts
+- Model [root node]
| +- Part A
| | +- Part A::Body A
| +- Part B
| | +- Part B::Body B
| | | +- ShapeBinder001
| +- Part C
| | +- Part C::Body C
7. Finally create the sketch under Part B::Body B, and refer to the shape binder from there…

A bit cumbersome, but this method is foolproof so far :) (and yes you have to move twice, you can go directly to the body you have to place the binder first into the part, and then move from part to body…)

I hope this clarifies…
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Designing an enclosure from Assembly 4 elements

Post by Zolko »

goutnet wrote: Fri Nov 11, 2022 9:33 am 2. Make "Model" the active part
3. Select PartB::Body B
4. Create a binder from there (binder will end up under the parent node directly):
5. move the binder manually to Part B (drag&drop from Model to Part B)
6. move the binder manually to Part B::Body B (drag&drop from Part B to Part B::Body B)
7. Finally create the sketch under Part B::Body B, and refer to the shape binder from there…

I hope this clarifies…
it confuses me even more: why don't you edit directly PartB in its own document ? Why do you use the assembly shapebinder *ON* PartB if you want to use *IN* in PartB ?
try the Assembly4 workbench for FreCAD — tutorials here and here
Post Reply