App.DocumentObject' object has no attribute 'Shape'

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!
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

FreeCad:
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.2.29177 +426 (Git)
Build type: Release
Branch: (HEAD detached from 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.8.10, Qt 5.15.2, Coin 4.0.1, Vtk 8.2.0, OCC 7.6.3
Locale: English/United States (en_US) [ OS: English/United States (en_US) ]
Installed mods:
* 3D_Printing_Tools
* FEMbyGEN 1.2.0
* Help 1.0.3

Used Tutorial "Creating a simple part with Part Design". Fully constrained.
Used "Pad" to create 3d. Added hole per tutorial.
When I run 3d_Printer_Slicer.FCMacro I get the following error :

08:33:38 Traceback (most recent call last):
File "C:/Users/15172/AppData/Roaming/FreeCAD/Macro/3d_Printer_Slicer.FCMacro", line 39, in <module>
volume = obj.Shape.Volume
<class 'AttributeError'>: 'App.DocumentObject' object has no attribute 'Shape'

Why would I not have that attribute visible to the slicer?

Thanks
Robert
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by Roy_043 »

The macro does not check if the visible document objects it tries to process actually have a Shape. You need to make the Origin of the Body and its subelements invisible yourself.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: App.DocumentObject' object has no attribute 'Shape'

Post by GeneFC »

tultalk wrote: Thu Jan 26, 2023 1:42 pm
I have not researched this, but the wiki https://wiki.freecadweb.org/Macro_3d_Printer_Slicer/en shows

Code: Select all

Last modified: 2013-10-10
If that is correct it is highly likely that there have been changes in FreeCAD that are incompatible.

Gene
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

If this is correct: If that is correct it is highly likely that there have been changes in FreeCAD that are incompatible.

What to do????

Thanks
Robert
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

The macro does not check if the visible document objects it tries to process actually have a Shape. You need to make the Origin of the Body and its subelements invisible yourself.
Tried that. Origin invisible. No sub-elements. Same error.
Thanks
Robert
User avatar
Roy_043
Veteran
Posts: 8539
Joined: Thu Dec 27, 2018 12:28 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by Roy_043 »

Hmm, maybe check again. The Origin of a Body has 6 subelements, 3 axes and 3 planes.
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

Hmm, maybe check again. The Origin of a Body has 6 subelements, 3 axes and 3 planes.

I toggled visibility and the axes etc disappeared. Tried slicer macro again, same issue.

Robert
User avatar
onekk
Veteran
Posts: 6199
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: App.DocumentObject' object has no attribute 'Shape'

Post by onekk »

The macro is very old and probably unmaintained.

In another post someone has tried to make it work, with mixed results if I remember well it is written for Python2.

But I could remember wrong.

If it is unmaintained since 2013 however there is not much interest in it so probably what you are trying to achieve actually could be made in some other way with FreeCAD.

But you have told nothing about what you are trying to do.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

Hi: Thanks for response.

I am trying to learn the ropes of FreeCad and 3d printing. I am trying to get a 3d model that I can run through slicer and pint on the 3d printer.
I wanted to do the model myself and not just use someone else's.

So I bought a 3d printer, etc and went with FreeCad as recommended by a friend.

I downloaded and printed a bunch of tutorials for FreeCad. The one I selected for my edification was "Creating A Simple Part With Part Design".

Having an engineering background and 25+ years of supervising drafters and engineers at Bechtel Power Corp in the design and building of Nukes as well as Field Project Engineer on fossil plants, I jumped right in and made the drawings using Sketcher and not as was suggested in the two tutorials I consulted. Reading further I suspect that the missing property "Shape" that has broken my attempt at slicing was to be generated under "Part", "Part Design" but not so under "Sketcher". After that I made the assumption (wrongly I suspect) that opening up my sketcher design in "part Design"/"Part WB" would miraculously impose the missing property "Shape". In trying to solve this dilemma, I assumed that "TopoShape" might the a new name for the same parameter and changed it so in the Macro which also caused slicer "Attribute Error" as before.

So I am faced with starting all over and following the tutorial directions explicitly or trying to fix my design. It would be more educational to try to fix my design but perhaps impossible at this stage. I do not know the limitations of FreeCad with regards to repairing a defect in design but so far have learned a great deal in its use.

As you point out, some of the components of FreeCad are vary old and have not necessarily been updated to reflect interactions with the current core program so I may be beating a dead horse.

Please advise.

Thanks
Robert
tultalk
Posts: 39
Joined: Tue Jan 17, 2023 3:01 pm

Re: App.DocumentObject' object has no attribute 'Shape'

Post by tultalk »

Hi

have not researched this, but the wiki https://wiki.freecadweb.org/Macro_3d_Printer_Slicer/en shows


Last modified: 2013-10-10

If that is correct it is highly likely that there have been changes in FreeCAD that are incompatible


I am not using the FreeCad slicer. I am using the Creality Slicer 4.8.2 which may be incompatible.
Who knows.

Thanks Robert
Last edited by tultalk on Fri Jan 27, 2023 4:27 pm, edited 2 times in total.
Post Reply