feature request, move surface of object to XY-plane

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

feature request, move surface of object to XY-plane

Postby freecc » Sat Apr 20, 2019 10:13 pm

I model things and want to 3d print them. Every part has to be moved to the XY plane to be in the correct place in the slicer. So I am requesting this feature. That I can just click on a face and move it to the XY-plane. Put the center of the object on the z axis if it is possible.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: feature request, move surface of object to XY-plane

Postby NormandC » Sun Apr 21, 2019 3:30 am

I'm pretty sure someone proficient in Python could make a macro for that.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: feature request, move surface of object to XY-plane

Postby NormandC » Sun Apr 21, 2019 4:09 am

Actually, somebody (openBrain) already did! :D

[Macro] Straighten objects

How to use:

  1. Select a face on the solid(s) to move to the XY plane; optionally select an edge as well
  2. Launch the macro
  3. Bam! You're done. ;)

Note: if you are working with a PartDesign Body, you first need to set its "Display Mode Body" property in the View tab from "Through" to "Tip", or it won't work as expected.
freecc
Posts: 158
Joined: Wed Feb 21, 2018 4:17 pm

Re: feature request, move surface of object to XY-plane

Postby freecc » Sun Apr 21, 2019 1:57 pm

NormandC wrote:
Sun Apr 21, 2019 4:09 am
Actually, somebody (openBrain) already did! :D

[Macro] Straighten objects

How to use:

  1. Select a face on the solid(s) to move to the XY plane; optionally select an edge as well
  2. Launch the macro
  3. Bam! You're done. ;)

Note: if you are working with a PartDesign Body, you first need to set its "Display Mode Body" property in the View tab from "Through" to "Tip", or it won't work as expected.
thank you!
openBrain
Posts: 3402
Joined: Fri Nov 09, 2018 5:38 pm

Re: feature request, move surface of object to XY-plane

Postby openBrain » Sun Apr 21, 2019 5:49 pm

NormandC wrote:
Sun Apr 21, 2019 4:09 am
How to use:
  1. Select a face on the solid(s) to move to the XY plane; optionally select an edge as well
  2. Launch the macro
  3. Bam! You're done. ;)
Just a precision. The extra edge if used, it will be set parallel to X axis.
[/quote]
Note: if you are working with a PartDesign Body, you first need to set its "Display Mode Body" property in the View tab from "Through" to "Tip", or it won't work as expected.
[/quote]
@NormandC, do you have an example where the Display Mode Body set to Through leads to issues. The macro normally correctly manages this case. I did some basic testing and got no bug, thus I'll be interested if you have a demo file that fails. ;)