[SOLVED] Attach LCS to the midpoint of a line

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] Attach LCS to the midpoint of a line

Post by PAS_Drafter »

Hi

I'd like to attach my LCS for an assembly to the midpoint of a line. The line could get wider or narrower depending on how the part gets changed, but I want the attachment point to always be the midpoint. See picture.

attachtomidpoint.PNG
attachtomidpoint.PNG (38.98 KiB) Viewed 1088 times

I've tried using the two points as shown or just the line. If I select "Inertial CS", it gives me what I want, but then the Report View starts complaining and says the various axis are undefined. I don't like having errors come up so I'm looking for a way to avoid that. If I use the Align O-Z-X when selecting points or Tangent with Z when selecting the line, the axis of the LCS line up the way I want, but it connects to one end of the line.

I can adjust the connection by adjusting the X, Y, or Z direction, but I don't know how to determine what the length of the line is (since it is dynamic) and then use half of it. I am assuming there is a way to use the equation editor to pull the length of the line of the Shapebinder somehow, but I don't have much experience with macros or software side to know what "variable" I'd need to grab.

Is there an easy way to do this?

Thanks

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)
Last edited by PAS_Drafter on Thu Sep 16, 2021 8:17 pm, edited 1 time in total.
User avatar
Shalmeneser
Veteran
Posts: 9580
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Attach LCS to the midpoint of a line

Post by Shalmeneser »

* Select line
* Datum LCS (tangent Z)
* Close
* Combo view > Data > Map path parameter = 0,5
PAS_Drafter
Posts: 339
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: Attach LCS to the midpoint of a line

Post by PAS_Drafter »

Well, that was even easier that I expected. There are so many little tricks like that, I don't know how anyone can learn (remember) them all

Thanks
Last edited by PAS_Drafter on Thu Sep 16, 2021 8:58 pm, edited 2 times in total.
Bance
Veteran
Posts: 4269
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: [SOLVED] Attach LCS to the midpoint of a line

Post by Bance »

Post Reply