Error when importing Arch module

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Error when importing Arch module

Post by peterl94 »

Hi,

I was testing my mac build and I discovered that I couldn't import the Arch module in FreeCADCmd. It works fine in the gui.

Code: Select all

>>> import Arch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Peter\FreeCAD\FreeCAD_0.14\Mod\Arch\Arch.py", line 30, in <module>
    FreeCADGui.updateLocale()
AttributeError: 'module' object has no attribute 'updateLocale'
Does anyone else have this problem?
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Error when importing Arch module

Post by jmaustpc »

Hi Peter
I get exactly the same here with this build on Linux

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3052 (Git)
Branch: master
Hash: 88ff8076cdbcca2a52c13f40d1cb14df220b3c55
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0


Jim
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Error when importing Arch module

Post by jriegel »

Thats because Arch is dependent on the Gui. There fore its not usable in the command line and server version of FreeCAD. That means also you can not load a project which include Arch objects in FreeCADCmd.exe.

I'm not sure Yorik did that on purpose or it just happened.
Stop whining - start coding!
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Error when importing Arch module

Post by jmaustpc »

You need the gui to export stl files so I was wonder if it is because its going to use meshes a bit and at least some mesh stuff requires the GUI?
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Error when importing Arch module

Post by yorik »

Actually it might be considered a bug... Indeed I never really adapted the Arch module to work without GUI yet :oops: I'll fix this ASAP. issue #1362
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Error when importing Arch module

Post by peterl94 »

Okay, I just wanted to make sure it wasn't a problem with my build.
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Error when importing Arch module

Post by rockn »

Hi,
Is Arch always able to work without Gui ?
I try to run a script with Arch.makeStructure() on a server. FreeCAD is compiled without Gui.
I get this :

Code: Select all

web1@woodserver:~/web/FreeCADWeb/examples/kit$ FreeCADCmd 
FreeCAD 0.14, Libs: 0.14R3727 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> import Arch
>>> App.newDocument()
<Document object at 0x145d3f0>
>>> Arch.makeStructure()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Mod/Arch/ArchStructure.py", line 298, in makeStructure
    _ViewProviderStructure(obj.ViewObject)
  File "/usr/local/Mod/Arch/ArchStructure.py", line 654, in __init__
    ArchComponent.ViewProviderComponent.__init__(self,vobj)
  File "/usr/local/Mod/Arch/ArchComponent.py", line 622, in __init__
    vobj.Proxy = self
AttributeError: 'NoneType' object has no attribute 'Proxy'
>>> 
Do I forget something?
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Error when importing Arch module

Post by yorik »

Ah indeed I never really tested the Arch module in console mode... Good opportunity! I'll have a look at that.
User avatar
rockn
Veteran
Posts: 1791
Joined: Wed Sep 28, 2011 10:39 am
Location: Toulouse, France
Contact:

Re: Error when importing Arch module

Post by rockn »

At the moment I have commented all reference to ViewProvider directly in the sources (makeStructure, makeStructuralSystem, WorkingPlane, makeAxis ...). It is working good (I can create a Structure and export it in webgl, it's just that all object are grey).
Formations - Assistance - Développement : https://freecad-france.com
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Error when importing Arch module

Post by yorik »

Ok this should be all fixed now!
Post Reply