Variable length part

Discussion about the development of the Assembly workbench.
Josh780
Posts: 2
Joined: Wed Jul 01, 2020 3:28 am

Variable length part

Postby Josh780 » Wed Jul 01, 2020 3:51 am

I've only been using FreeCAD for about 3 days so far, so this may be a newbie question, but I'm having trouble figuring something out. I'd like to create a part with a variable length that can be assigned/changed during assembly. Specifically, I'm building a model of a PVC structure, and it would be nice to create a single PVC pipe part that could be assigned different lengths for each copy in the assembly rather than create multiple parts for every possible length being used.

Is this possible? What is the best way to accomplish it?

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
chrisb
Posts: 25204
Joined: Tue Mar 17, 2015 9:14 am

Re: Variable length part

Postby chrisb » Wed Jul 01, 2020 7:42 am

Hi and welcome to the forum!

I moved your post to the Assembly forum.

You should add the information which assembly workbench you use.
User avatar
Zolko
Posts: 935
Joined: Mon Dec 17, 2018 10:02 am

Re: Variable length part

Postby Zolko » Wed Jul 01, 2020 7:52 am

Josh780 wrote:
Wed Jul 01, 2020 3:51 am
I'd like to create a part with a variable length that can be assigned/changed during assembly.
...
Is this possible? What is the best way to accomplish it?
This is a recurrent question:

https://forum.freecadweb.org/viewtopic. ... riant+link
https://forum.freecadweb.org/viewtopic. ... nk#p405339
https://forum.freecadweb.org/viewtopic.php?f=22&t=42331
https://forum.freecadweb.org/viewtopic. ... nk#p405339

and very recently here:

https://forum.freecadweb.org/viewtopic. ... 60#p412094

So the short answer is: sort-of yes and no. I would say that there is currently no good way of doing it.

Lei, shouldn't we try to really solve this problem with variant links ? I'm afraid it's above my boxing league.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
ppemawm
Posts: 662
Joined: Fri May 17, 2013 3:54 pm
Location: Manhattan New York

Re: Variable length part

Postby ppemawm » Wed Jul 01, 2020 1:57 pm

Josh780 wrote:
Wed Jul 01, 2020 3:51 am
I'd like to create a part with a variable length that can be assigned/changed during assembly.
What you can do is to create the variable body in a separate file. Then, simply merge the body into the file in which you are building the assembly. You can change any of the parameters to your liking, but it will not be linked to the original.
"It is a poor workman who blames his tools..." ;)
Josh780
Posts: 2
Joined: Wed Jul 01, 2020 3:28 am

Re: Variable length part

Postby Josh780 » Wed Jul 01, 2020 6:59 pm

Thank you both for the thoughtful replies. I figured this might be a recurrent question, but it seems I just wasn't using the right search terms or at least not in the right forum.

I've read through these other discussions, but it may take me some time to fully wrap my head around the different implementations. I like the idea of variant links - that sounds ideal, but not quite rolled out yet. For now, a couple questions come to mind:
  1. Is the concept of a "scale vector" unique to Assembly 4?
    • I just started learning A2plus and am not finding the same functionality there. It sounds like scaling could be the answer I'm looking for (for now).
  2. Is this SubShapeBinder worth investigating further for my purpose?
    • I don't fully understand it yet, but perhaps I'll need to see a few more tutorials on ShapeBinders.
  3. What exactly is a "variable body"?
    1. And how would I "merge" the body into my assembly file? Just copy/paste it?
  4. In your expertise, knowing none of the solutions are "good", which would be the easiest and/or most appropriate for me to implement at this point? (Not necessarily one listed above)
    1. Can you point me to some good documentation/walk-through to get me started?
Since I'm just beginning with FreeCAD, I opted for 0.18 for stability, but if 0.19 offers any of these features I'm looking for, I'm open to switching. Also, I'm quite green in the CAD world, and my only prior experience was a little bit of SketchUp, so I apologize for my limited grasp of these concepts. The amount of information available for FreeCAD is a bit overwhelming, so if there are any specific tutorials you'd recommend, I'm all ears.

Thanks,
-Josh
User avatar
fosselius
Posts: 359
Joined: Sat Apr 23, 2016 10:03 am

Re: Variable length part

Postby fosselius » Fri Jul 03, 2020 11:02 am

drmacro
Posts: 971
Joined: Sun Mar 02, 2014 4:35 pm

Re: Variable length part

Postby drmacro » Fri Jul 03, 2020 3:24 pm

Josh780 wrote:
Wed Jul 01, 2020 6:59 pm
In one case I was making a angle frame. So, 4 legs were one length, 4 front spreaders were one length, 4 side spreader were one length.

I use A4 WB.


- put each length in the spreadsheet
- created the sketch
- created a body/shapebinder for each length
- padded each binder with a length from the spreadsheet
- in each body I added an LCS
- named all so I could figure them out.
- saved the file.
- closed the file

- Opened/created an assembly file.
- opened the file created above.
- linked to and subsequently positioned the various length angles.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."

My beginners, written treatise: Learning FreeCAD
Grawp
Posts: 16
Joined: Sat Mar 03, 2018 9:34 am

Re: Variable length part

Postby Grawp » Sat Jul 04, 2020 5:23 pm

I too am looking for something like variant links. From OpenSCAD and CadQuery I'm used to modules/methods which
  • Can be reused with different parameters.
  • Can reside in their own files.
  • Can be not only union something to a specified model but also cut and even otherwise modify it.
For the 2nd and a part of the 3rd point (the cutting beside the concatenating) you can use a partdesign-thingy in DeepSOIC's Lattice2. The functionality is so extremely essential for me that I have a feeling that I'm having a flawed workflow needing an external workbench/plugin for every single model that I do and not using something from basic FreeCAD tools.

For example I have a PD body representing a 'cutter' which is supposed to cut a hole && also a space for embedding a nut. I then apply it to various places in an other PD body e.g.:
Screenshot_20200704_191650.png
Screenshot_20200704_191650.png (7.86 KiB) Viewed 158 times
I would very very useful If the 'cutter' PD body could be parametric in its applications. Like using the same 'cutter' template for different nut sizes.
dan-miel
Posts: 130
Joined: Thu Sep 13, 2018 12:29 am
Location: Spokane WA. USA

Re: Variable length part

Postby dan-miel » Mon Jul 06, 2020 6:00 am

Josh780 wrote:
Wed Jul 01, 2020 3:51 am
I'd like to create a part with a variable length that can be assigned/changed during assembly. Specifically, I'm building a model of a PVC structure, and it would be nice to create a single PVC pipe part that could be assigned different lengths for each copy in the assembly rather than create multiple parts for every possible length being used.
Josh. Not quite what you're looking for but I'll throw it out here anyway. This is for A2plus.
I just posted some files for a workbench that I use but it is not FreeCAD approved. With it you can change a part’s shape with a few button clicks.
Overall process for changing a part file: You create a pipe file and insert that file in your assembly. Then using that file as your “base” you need to copy the file and change it for each length (which you don’t want to do). You then put the modified files in the assembly but don’t constrain them. You can then change the files using the constraint Viewer part of the work bench I made. I'll put step by step here.

Add the files to the assembly.
Open the work bench and click the lantern which will open the viewer.
Select the part you want to change.
Click on the "misc" menu then "Change Part".
Click on the part to replace the first part. They should swap places.

Warnings: The files do not change. It is only swapping the shapes between the bodies. I have not tested it because it was just a fun thing to try but if you’re working on some temporary files it might work. No one has tested these files, I’m not sure if they will run on any machine but mine. The workbench helps me reduce the number of broken constraints that are made when a part is modified in A2plus.

Dan
Attachments
Change part.JPG
Change part.JPG (21.5 KiB) Viewed 88 times