Error when importing Arch module

A forum dedicated to the Arch and BIM workbenches development.
peterl94
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Error when importing Arch module

Postby peterl94 » Wed Jan 22, 2014 1:02 am

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
Posts: 8827
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Error when importing Arch module

Postby jmaustpc » Wed Jan 22, 2014 3:50 am

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
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Error when importing Arch module

Postby jriegel » Wed Jan 22, 2014 8:05 am

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
Posts: 8827
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Error when importing Arch module

Postby jmaustpc » Wed Jan 22, 2014 12:44 pm

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
Site Admin
Posts: 10605
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Error when importing Arch module

Postby yorik » Wed Jan 22, 2014 12:44 pm

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
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Error when importing Arch module

Postby peterl94 » Wed Jan 22, 2014 5:05 pm

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

Re: Error when importing Arch module

Postby rockn » Thu Jul 17, 2014 6:53 pm

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 et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
yorik
Site Admin
Posts: 10605
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Error when importing Arch module

Postby yorik » Thu Jul 17, 2014 8:50 pm

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

Re: Error when importing Arch module

Postby rockn » Thu Jul 17, 2014 10:02 pm

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 et tutoriels FreeCAD en Français, soutenez moi : https://www.tipeee.com/formations-freecad
User avatar
yorik
Site Admin
Posts: 10605
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Error when importing Arch module

Postby yorik » Thu Jul 17, 2014 11:01 pm

Ok this should be all fixed now!