View Issue Details

IDProjectCategoryView StatusLast Update
0000618FreeCADBugpublic2012-03-11 09:05
Reporterdjreichel Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.12 
Fixed in Version0.13 
Summary0000618: View PartDesign Workbench fails: 'module' object has no attribute 'makeFilletArc'
Descriptioncommit 5145acf1e4b45111c3cab12311c62c0026cd4f0f
Author: tanderson <blobfish[at]gmx.com>
Date: Thu Mar 1 16:58:56 2012 -0500

built on Fedora 16

Additional InformationI was able to suppress this message and load PartDesign by editing
the file: /Mod/PartDesign/__init__.py to remove the makeFilletArc
reference.

cat __init__.py
import PartDesign
#makeFilletArc = PartDesign.makeFilletArc

PartDesign.makeFilletArc is not available to scripting.

I'm still learning what works in this build, but if it's helpful
to know, I *can* see Part.makeCircle from a python script both in
the Gui Python Console and from scripts run through FreeCADCmd.


TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2012-03-03 18:24

administrator   ~0001703

Did you build with automake or cmake?

When you enter:
import PartDesign
you only load the __init__.py file. That's why we do the assignment
makeFilletArc = PartDesign.makeFilletArc

So that you can do:
import PartDesign
PartDesign.makeFilletArc(...)

Without this you have to do:
import PartDesign
PartDesign.PartDesign.makeFilletArc(..)

or

from PartDesign import PartDesign
PartDesign.makeFilletArc(...)

Since you get an error here it seems that the file PartDesign.so cannot be found by Python. Or can you do this:

from PartDesign import PartDesign as pd
pd.__file__

djreichel

2012-03-03 19:00

reporter   ~0001704

Last edited: 2012-03-03 19:15

Build was with Automake.

I rebuilt with: commit 0d782797a082ebdba039530861abab9a9d8fb6a5
Author: wmayer <wmayer(a)users.sourceforge.net>
Date: Sat Mar 3 18:24:49 2012 +0100

And the problem is gone. I had made a test script:

[dennis@verne ~]$ cat test.py
import Part, PartDesign
makeCircle=Part.makeCircle
print "Here we Die"
makeFilletArc=PartDesign.makeFilletArc
quit()

Running in FreeCADCmd, formerly it would fail at:
makeFilletArc=PartDesign.makeFilletArc

I understand from your above comment that this test's failure
did not address the question of whether or not PartDesign.so
was found...

Unfortunately I do not have the bad build to test
your suggestion.

from PartDesign import PartDesign as pd
pd.__file__

I *did* try: from PartDesign import makeFilletArc
and the message was the same <module>,etc..

However I should also mention that while this was not working
I could browse in the Python Console object completion mode and saw:
PartDesign.__builtins__, __doc__, and the rest, but there was not a
PartDesign.makeFilletArc. This suggest to me that PartDesign was found by FreeCAD, but the makeFilletArc method was not visible.

I'm not sure if this is a "can not reproduce" or a "problem solved"

wmayer

2012-03-03 20:41

administrator   ~0001705

I have done some tests:
If I delete the PartDesign.so (PartDesign.pyd under Windows) the
"import PartDesign" failed with the same error you posted. If I now comment out the second line in __init__.py it works.

So, I conclude that on the previous version the PartDesign.so file was missing.

I think this issue can be regarded as resolved. What do you think?

djreichel

2012-03-08 03:37

reporter   ~0001722

To check out some other issues, I built the FreeCad 0.12 tarball that's posted on FreeCAD's source code download page: freecad-0.12.5284.tar.gz 2012-01-04 48.4 MB, and commented out import PartDesign's #makeFilletArc = PartDesign.makeFilletArc and did the following test to repicate this bug.

[dennis@verne .FreeCAD]$ freecad-0.12-Cmd
FreeCAD 0.12, Libs: 0.12R5382
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
  ##### #### ### ####
  # # # # # #
  # ## #### #### # # # # #
  #### # # # # # # # ##### # #
  # # #### #### # # # # #
  # # # # # # # # # ## ## ##
  # # #### #### ### # # #### ## ## ##

[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> from PartDesign import PartDesign as pd
pd.__file__>>>
'/usr/lib/freecad-0.12/PartDesign/__init__.py'
>>> pd.makeFilletArc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'makeFilletArc'
>>>

Somehow this *has* been corrected between 2012-01-04 and the present.

djreichel

2012-03-10 22:47

reporter   ~0001737

Missing reference to FilletArc.py in Makefile.am

[freecad@verne git]$ diff -uNr freecad-0.12/ freecad-local/
diff -uNr freecad-0.12/src/Mod/PartDesign/Scripts/Makefile.am freecad-local/src/Mod/PartDesign/Scripts/Makefile.am
--- freecad-0.12/src/Mod/PartDesign/Scripts/Makefile.am 2012-03-04 11:59:01.576207870 -0500
+++ freecad-local/src/Mod/PartDesign/Scripts/Makefile.am 2012-03-10 18:35:13.113324871 -0500
@@ -2,12 +2,13 @@
 datadir = $(prefix)/Mod/PartDesign/Scripts
 data_DATA = \
                __init__.py \
- Gear.py \
                DistanceBolt.py \
- Epitrochoid.py \
- RadialCopy.py \
- Parallelepiped.py \
- Spring.py
+ Epitrochoid.py \
+ FilletArc.py \
+ Gear.py \
+ Parallelepiped.py \
+ RadialCopy.py \
+ Spring.py
 
 EXTRA_DIST = \
                $(data_DATA)
[freecad@verne git]$

wmayer

2012-03-11 09:05

administrator   ~0001741

Added in git bd24d5beaf312b26822cd01122343249b3a2811b (0.13)

Issue History

Date Modified Username Field Change
2012-03-03 17:55 djreichel New Issue
2012-03-03 18:24 wmayer Note Added: 0001703
2012-03-03 19:00 djreichel Note Added: 0001704
2012-03-03 19:15 djreichel Note Edited: 0001704
2012-03-03 20:41 wmayer Note Added: 0001705
2012-03-08 03:37 djreichel Note Added: 0001722
2012-03-08 06:22 wmayer Status new => closed
2012-03-08 06:22 wmayer Resolution open => no change required
2012-03-08 06:22 wmayer Fixed in Version => 0.13
2012-03-10 22:47 djreichel Note Added: 0001737
2012-03-10 22:47 djreichel Status closed => feedback
2012-03-10 22:47 djreichel Resolution no change required => reopened
2012-03-11 09:05 wmayer Note Added: 0001741
2012-03-11 09:05 wmayer Status feedback => closed
2012-03-11 09:05 wmayer Resolution reopened => fixed