Assembly4 - how do you get 'link copy on change' to work?

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

Hi
Question, Assembly4 - how do you get 'link copy on change' to work?

The link copy on change function appears to work in Assembly 3 (if it is not a part or a body), however when I try to implement it in Assembly4 I cannot get it to work.
It seems that if the object is a 'part' or a 'body' then the link copy on change has no effect, but you need to have either a part or a body to insert the object into an Assembly 4 model.

I have tried 0.20.2, 0.21.32258 and 0.21.32198, all with no luck. I prefer to work with assembly4 (seems to be ultra stable and much faster when recomputing size changes) but have come to a full stop trying to attach cladding on a garden building.
I've got to be doing something wrong but there are no youtube tutorials showing how to use this feature.

Hope someone can help.

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32258 (Git)
Build type: Release
Branch: master
Hash: 0f4acc55beb66dcc9dfab442344c6286d6a2913e
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.60k
  * Assembly3 0.11.4
  * Assembly4 0.12.6
Attachments
ASSY4 Copy On Change Test.FCStd
(7.76 KiB) Downloaded 35 times
ASSY3 Copy On Change Test.FCStd
(8.14 KiB) Downloaded 36 times
PART Copy On Change Test.FCStd
(7.62 KiB) Downloaded 34 times
NO PART Copy On Change Test.FCStd
(5.36 KiB) Downloaded 35 times
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by Zolko »

jag45 wrote: Thu Mar 23, 2023 12:29 pm Question, Assembly4 - how do you get 'link copy on change' to work?
I don't really know what that is, and whether it can be used with Asm4. But from what I've read it is similar to the Asm4 variant link, so you might want to try that instead. It depends on what you want to do.

For a variant link, create a Part (yellow icon) in a new document, in there create a variable (or many), now that Part can be inserted into an assembly as variant link where you adjust the above variable's value for each instance.
try the Assembly4 workbench for FreCAD — tutorials here and here
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

Thanks for your reply Zolko. It certainly looks to be what I need, however after trying it I am having a problem as follows:

I put the 3 variants into an assembly as per the attached file and entered an expression in the cubes box length property pointing to the variant variable required.

Then changing the variant variable changed the length of the cubes as expected.
I then closed and saved the files and reopened them.

The variant variables values were saved but the cube expressions had not been saved so the sizes had reverted back to the original part sizes.
Variant.png
Variant.png (47.46 KiB) Viewed 1365 times
Attachments
PART Copy On Change Test.FCStd
(6.31 KiB) Downloaded 34 times
ASSY4 Copy On Change Test.FCStd
(9.49 KiB) Downloaded 34 times
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

OK, I think I've got it.

It looks like the expression should be entered in the Part:Cube properties, not the Variant:Cube properties in the assembly.
Doing it this way the sizes are saved on closure of the files and are there on reopening.

The only annoying thing are the messages telling me my cache files do not exist.

Thanks for your help Zolko. Look forward to seeing a working BOM.
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

Hi
I am still having problems with variant parts.

Using the attached files, change the 3_var variant size.
Although the cube resizes as expected the two cubes are not attached properly until you force a recompute on the variant entry in the assembly. Forcing a recompute on the model has no effect.
I've tried everything I can think of but cannot get it to work.

Is this a known problem?

Thanks Jon

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.60k
  * Assembly3 0.11.4
  * Assembly4 0.12.6
Attachments
ASSY4 Variant Part Test.FCStd
(9.12 KiB) Downloaded 35 times
TEST PART 1.FCStd
(8.84 KiB) Downloaded 31 times
TEST PART 3.FCStd
(9 KiB) Downloaded 34 times
alanscodelog
Posts: 5
Joined: Sat Apr 23, 2022 12:50 am

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by alanscodelog »

The problem I see in your files I think is you're trying to "enable copy on change" on the part but it's the cube that has the changeable properties. The properties must be at the same level as the link. Note how in your Assembly 3 file you're linking to the cube directly.

Regular variant links do work with Assembly 4, just be warned that if you're planning to have multiple copies of the same part in one assembly, their attachments will sometimes break when the link is refreshed. This is because the numbering of the LCS used to attach it might change when the variant link is recomputed. That's really the only main problem. I've found setting them to "Tracking" instead of just "Enabled/Owned" helps a bit, idk why. And of course making them easy to re-attach also helps.

I prefer them because they're simpler to make than variant links, work on bodies, and you can have configurations with a configuration table in a spreadsheet (I never figured out how to do a similar thing with the Assembly 4 variants).
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

alanscodelog wrote: Thu Mar 30, 2023 1:07 am The problem I see in your files I think is you're trying to "enable copy on change" on the part but it's the cube that has the changeable properties. The properties must be at the same level as the link. Note how in your Assembly 3 file you're linking to the cube directly.
.....
Thanks for the reply
I don't think I'm explaining this latest issue properly, so bear with me while I look up how to record screen and mouse movements to get a vid showing what's happening.
J
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

With reference to the new attached files below (Please use these not any others):
Also forget the link copy on change heading. ASM4 doesn't use that, it uses the variants instead.


This is a simplified version of the issue I have.

I have two frames (back frame and side frame), with cladding attached to each frame by points at the centre of mass on the face.

The cladding share the same profile (although here it is a simple rectangle and only one piece per frame is shown) and so they are placed into the assembly as Variants because they have different lengths adjusted to fit the side and back frame as required.

So using the files attached below:
1) Open the file'Assembly.FCStd. This should open the other files

If you then go edit the BACK BOTTOM LENGTH and SIDE BOTTOM LENGTH entries in the 'Input Sizes' file, Then go back to the assembly and click the 'Refresh' button to recompute. The two cladding lengths will be resized accordingly. However they lose their positions. (Note, this only seems to happen for the variant parts. The other parts are redrawn correctly)

Marking the 'Assembly' for recompute has no effect. You have to go into the tree on the 'Assembly/model/Back_Frame/VARIANT_BACK_CLADDING' entry and mark that for recompute. The cladding will then jump into the correct position when you press the 'refresh' button.

You have to do the same thing for the VARIANT_SIDE_CLADDING entry.

In these files I am using 'points' to locate the parts with each other (so easy to implement with these objects), in my proper files I am using LCS's with the same results.

Which is not too much of a problem in this instance but could be a nightmare in a large assembly with many variant parts.

One other thing is the reason I have separate files 'Back Bottom' and 'Side Bottom' is because it appears that although you can put a variant in an assembly and adjust sizes you cannot attach items to them as they do not appear in the 'Place Linked Part Box/attach to' dialog box.
Hopefully this is enough to help you understand the issue.

Looks like I can only attach 5 files so see the next post for the remaining 3 files.
Attachments
SIDE BOTTOM.FCStd
(8.14 KiB) Downloaded 33 times
CLADDING.FCStd
(6.22 KiB) Downloaded 35 times
BACK FRAME.FCStd
(9.99 KiB) Downloaded 33 times
BACK BOTTOM.FCStd
(8.57 KiB) Downloaded 35 times
ASSEMBLY.FCStd
(9.78 KiB) Downloaded 35 times
jag45
Posts: 28
Joined: Tue May 17, 2022 9:44 pm

Re: Assembly4 - how do you get 'link copy on change' to work?

Post by jag45 »

Remaining 3 attached file from my last post.
J

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.32552 (Git)
Build type: Release
Branch: master
Hash: e2b3a5d2f791fb78a61daac9bdab374058f682f2
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * A2plus 0.4.60k
  * Assembly3 0.11.4
  * Assembly4 0.12.6
Attachments
INPUT SIZES.FCStd
(1.79 KiB) Downloaded 35 times
UPRIGHT.FCStd
(6.63 KiB) Downloaded 32 times
SIDE FRAME.FCStd
(10.01 KiB) Downloaded 35 times
Post Reply