[Solved] Part Design Part missing "Origin" feature
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
[Solved] Part Design Part missing "Origin" feature
I've just been working on a new file and made quite a bit of progress between saves so I don't have a backup save without this issue.
Something happened and I managed to delete the "Origin" feature in a Part Design part (the container that holds the X, Y, Z planes and axis). Is there a way to get this back? It not being there seems to have broken a few things such as any time a sketch is moved.
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
Something happened and I managed to delete the "Origin" feature in a Part Design part (the container that holds the X, Y, Z planes and axis). Is there a way to get this back? It not being there seems to have broken a few things such as any time a sketch is moved.
OS: Ubuntu 18.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 2.7.15rc1
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
Last edited by Will2 on Fri Mar 29, 2019 4:34 pm, edited 1 time in total.
Re: Part Design Part missing "Origin" feature
I only know of two ways, and none of them is really fun.
1.) Fast, but no guarantee for success:
- Create another file with a similar body.
- unzip both files or use Tools->Project utility to unpack.
- Look through Document.xml in both files, search for "Origin" and try to restore it.
- repack the zip file
- open in FreeCAD and perforem a full recompute
2.) Slower but safer
- Create a new body,
- transfer everything from the old body into the new
- If you don't succeed to transfer the features you almost always can reuse the sketches.
- rebuild dependencies to other bodies
1.) Fast, but no guarantee for success:
- Create another file with a similar body.
- unzip both files or use Tools->Project utility to unpack.
- Look through Document.xml in both files, search for "Origin" and try to restore it.
- repack the zip file
- open in FreeCAD and perforem a full recompute
2.) Slower but safer
- Create a new body,
- transfer everything from the old body into the new
- If you don't succeed to transfer the features you almost always can reuse the sketches.
- rebuild dependencies to other bodies
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Part Design Part missing "Origin" feature
There is something buggy here. I just tried to delete Origin and all its components and FreeCAD refuses to do so. On a plane that has sketches it warns for the dependency but then nothing happens. So it should not be possible to remove Origin. And when it happens there is a bug somewhere. To bad that it is not easily reproducible.
Re: Part Design Part missing "Origin" feature
Of course it's a bug. I guess it occurs in connection with some undos, where the body is restored, but not the origin.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Part Design Part missing "Origin" feature
Code: Select all
origin = App.ActiveDocument.addObject('App::Origin', 'Origin')
App.ActiveDocument.Part.Origin = origin #replace "Part" with the internal name of your Part.
Re: Part Design Part missing "Origin" feature
Faster than my fast way and safer than my safe way .DeepSOIC wrote: ↑Fri Mar 29, 2019 10:18 amCode: Select all
origin = App.ActiveDocument.addObject('App::Origin', 'Origin') App.ActiveDocument.Part.Origin = origin #replace "Part" with the internal name of your Part.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Part Design Part missing "Origin" feature
I used DeepSOIC's method and it worked right away, I think it's all good now, thank you very much! It may help track down the bug but I believe this happened around the time I selected all the features of a particular part and hit "Duplicate selected object" to make a copy of it. Though I don't have any other information other than that currently. I believe I did an "undo" after the duplicate because I made a mistake in it. I could not duplicate the same problem after I fixed the file.
Re: [Solved] Part Design Part missing "Origin" feature
The Part container is not a PartDesign element. It's a general "standard" element. Its toolbar icon is found in *all* workbenches along with the Group icon, not only in PartDesign. It was in PartDesign only in the very beginning of 0.17 development, but it was changed nearly 2 years ago.
Std Part
If you look for this command in the source code, you will not find it in the PartDesign workbench but in /src/Gui.
https://github.com/FreeCAD/FreeCAD/sear ... q=Std_Part
Re: [Solved] Part Design Part missing "Origin" feature
Good point. Though maybe I'm doing something wrong. I've been mostly using the blue "body" icon and not the yellow "part" icon. I was confused when I first started using the part design workbench and I guess I just stuck to using the blue "body" icon.NormandC wrote: ↑Fri Mar 29, 2019 5:01 pmThe Part container is not a PartDesign element. It's a general "standard" element. Its toolbar icon is found in *all* workbenches along with the Group icon, not only in PartDesign. It was in PartDesign only in the very beginning of 0.17 development, but it was changed nearly 2 years ago.
Std Part
If you look for this command in the source code, you will not find it in the PartDesign workbench but in /src/Gui.
https://github.com/FreeCAD/FreeCAD/sear ... q=Std_Part
- davidhbrown
- Posts: 19
- Joined: Fri Jan 12, 2018 6:08 am
Re: Part Design Part missing "Origin" feature
Thank you! Still working great in version 20.26858 I managed to need this after having deselected too many things when copying a part body to another document.DeepSOIC wrote: ↑Fri Mar 29, 2019 10:18 amCode: Select all
origin = App.ActiveDocument.addObject('App::Origin', 'Origin') App.ActiveDocument.Part.Origin = origin #replace "Part" with the internal name of your Part.
One tweak I'm not sure was necessary... I changed the second addObject() parameter from 'Origin' to 'Origin001' because there was already a body with an "Origin" in the document.