[Solved] Changing line link location to accommodate when other line moves

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
PAS_Drafter
Posts: 339
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

[Solved] Changing line link location to accommodate when other line moves

Post by PAS_Drafter »

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)


I have a part that needs to dynamically change shape if the height changes. I have a horizontal bar that a bracket is mounted to and I have another surface that needs to be able to go up and down depending on what value I need the height for that one. When attachment 2 is below attachment 1, I want one line to have a minimum that it will go down above the top of attachment 1 point so the bracket doesn't get too weak. However, if I go up, I want that top linked point to go up with the top of the bracket so that it gives it strength as it goes up.

As an example, here is a low position.
LowPos.PNG
LowPos.PNG (22.14 KiB) Viewed 457 times
If I move the Attachment 2 to the high position I can keep the top of the line above Attachment 1 at the same height like this pretty easily
HighPos.PNG
HighPos.PNG (21.17 KiB) Viewed 457 times
However, I want it to do this instead only if the Attachment 2 goes high Notice the new line at an angle.
Desired.PNG
Desired.PNG (20.97 KiB) Viewed 457 times
Is there any way to use an IF/THEN statement or some other way to allow this to happen automatically in the background? I suppose this might cause a Topographical Naming Problem though if the number of surfaces change.
Last edited by PAS_Drafter on Wed Jan 19, 2022 9:25 pm, edited 1 time in total.
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Changing line link location to accommodate when other line moves

Post by Shalmeneser »

* You should do 2 sketches (and 2 pad/pocket): 1 for static lines, 1 for modifiable lines.
* 2nd sketch need to always have the same number of lines (TNP - no refine)

No if/then but ternary operation.
PAS_Drafter
Posts: 339
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: Changing line link location to accommodate when other line moves

Post by PAS_Drafter »

I would have never thought to do that. I have the two sketches linked to a spreadsheet and I can use the If/Then there to adjust the length of the one segment to stay near 0 or increase as it goes higher. Not a pretty part, but at least it doesn't break now.
HighPos2.PNG
HighPos2.PNG (11.41 KiB) Viewed 414 times
LowPos2.PNG
LowPos2.PNG (9.55 KiB) Viewed 414 times
Post Reply