Reference(Datum) Line through sketch circle center?

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!
garya
Posts: 405
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Reference(Datum) Line through sketch circle center?

Post by garya »

Is there a way to make the center of a circle/arc visible so one can create a datum line through it?
I need a way to position two bodies at that point (e.g. for shaft alignment).

I can get at it from within a sketch in the second body, by creating a shape binder to the sketch in the first body which has the matching hole, and then creating an external link in the sketch in the second body to the circle in the shape binder, which makes the center show up. But I need the center of the hole in the first body for setting the placement property on the second body.
User avatar
Willem
Veteran
Posts: 1852
Joined: Fri Aug 12, 2016 3:27 pm
Location: Lisse, The Netherlands

Re: Reference(Datum) Line through sketch circle center?

Post by Willem »

Click with your mouse on the edge of the circle/cylinder and the Datumline automatically takes the center
chrisb
Veteran
Posts: 53948
Joined: Tue Mar 17, 2015 9:14 am

Re: Reference(Datum) Line through sketch circle center?

Post by chrisb »

Use AttachmentMode "Concentric". If it should go through the circle itself, turn it by 90°.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 405
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

Thanks, both of you.
If I select the datum line, I can see its z offset. If I give it a label, I see that also.
However, when I attempt to set the Placement z offset for another body, I can't figure out how to access the datum line.
The expression parser for the value in the property editor likes "Axis1_Mount" (the label for the body containing the new datum line), but doesn't show anything I think I should see when I type "Axis1_Mount.Ref_Ax1_HoleAxis" or "Axis1_Mount.Datum". I tried using the Python console to see how to access the parts of the body, but I couldn't figure that out, and I don't see a "list" type prodedure. The scripting tutorial didn't cover this.
Hints/pointers?
Bance
Veteran
Posts: 4192
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Reference(Datum) Line through sketch circle center?

Post by Bance »

chrisb
Veteran
Posts: 53948
Joined: Tue Mar 17, 2015 9:14 am

Re: Reference(Datum) Line through sketch circle center?

Post by chrisb »

garya wrote: Fri Oct 08, 2021 9:30 pm I can't figure out how to access the datum line.
In an expression you can use the name of the datum line directly without the "path" prefixed by the body name.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 405
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

chrisb wrote: Sat Oct 09, 2021 12:32 am In an expression you can use the name of the datum line directly without the "path" prefixed by the body name.
Messing with the console, I'm pretty confused.

If I click on a subobject of a body in a part, I see:
>>> Gui.Selection.addSelection('Assembly_1','Part','Body.')
selects "Assembly_1#Part.Body. (Axis1_Mount)"

If I enter in the python console:
>>> Gui.Selection.addSelection('Assembly_1','Part','Body.')
I see the same thing. ok so far.

If I enter:
>>> Gui.Selection.addSelection('Assembly_1','Part','Axis1_Mount')
I get "Assembly_1#Part.Axis1_Mount not found"

If I enter:
>>> Gui.Selection.addSelection('Assembly_1','Part','Axis1_Mount.')
I get "Assembly_1#Part.Axis1_Mount. not found"

are labels not allowed in the console for object selection?
They seem to be allowed in the Data display for setting properties like placement position and sketch constraints.
garya
Posts: 405
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

In my sketch, clicking on the DatumLine, I see the property:
Attachment:Attachment/Position/z is 0.0
but
Base: Placement/Position/z is 251.58
I want access to the Base: number.
If I type:
doc.DatumLine.Placement
into the console, I see:
Placement [Pos=(61,0,251.577), Yaw-Pitch-Roll=(90,0,90)]
ok.
If I type:
doc.DatumLine.Placement.Base.z
I get the number I'm looking for.
Why is it Placement.Base.z, given the hierarchy in the Data display is Base/Placement.Position.z?
How is one supposed to discover the path to a value? Finding the axis values is equally obtuse.
chrisb
Veteran
Posts: 53948
Joined: Tue Mar 17, 2015 9:14 am

Re: Reference(Datum) Line through sketch circle center?

Post by chrisb »

It is documented in Placement.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
garya
Posts: 405
Joined: Tue Nov 20, 2018 1:00 am
Location: Ovando, MT, USA

Re: Reference(Datum) Line through sketch circle center?

Post by garya »

Thanks, that helped.
One question not answered -- is one not allowed to use the renamed object (Label) for references? One can do this with constraints, but it doesn't seem to work for objects. It's rather awkward to have to use the generally meaningless freecad generated names.
Post Reply