Error when importing Arch module
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Error when importing Arch module
Ah about objects being grey, that is normal. When working in console mode, objects don't have their GUI part, and so they are without color information...
Re: Error when importing Arch module
There is a problem in importDXF.py
Replace "params" by "p" fix the issue.
Code: Select all
jo@woodserver:~$ FreeCADCmd
FreeCAD 0.15, Libs: 0.15R3792 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> import Draft
>>> import Drawing
>>> import Part
>>> import importDXF
DXF libraries not found. Downloading...
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfColorMap.py ...
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfImportObjects.py ...
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfLibrary.py ...
downloading https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/dxfReader.py ...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Mod/Draft/importDXF.py", line 1849, in <module>
dxfDefaultColor = getColor()
File "/usr/local/Mod/Draft/importDXF.py", line 277, in getColor
c = params.GetUnsigned("DefaultShapeLineColor",0)
NameError: global name 'params' is not defined
>>> exit()
Formations - Assistance - Développement : https://freecad-france.com
Re: Error when importing Arch module
Fixed, thanks!
Re: Error when importing Arch module
In WorkingPlane.py
In ArchStructure.py
In Draft.py
Code: Select all
FreeCADCmd
FreeCAD 0.15, Libs: 0.15R3792 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> import Arch
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Mod/Arch/Arch.py", line 39, in <module>
from ArchSectionPlane import *
File "/usr/local/Mod/Arch/ArchSectionPlane.py", line 24, in <module>
import FreeCAD,WorkingPlane,math,Draft,ArchCommands,DraftVecUtils
File "/usr/local/Mod/Draft/WorkingPlane.py", line 25, in <module>
import FreeCAD, FreeCADGui, math, DraftVecUtils
ImportError: No module named FreeCADGui
>>>
Code: Select all
File "/usr/local/Mod/Arch/ArchStructure.py", line 303, in makeStructure
obj.Base.ViewObject.hide()
AttributeError: 'NoneType' object has no attribute 'hide'
Code: Select all
dim = Draft.makeDimension(App.Vector(curseur, 0.0, 0.0),App.Vector(curseur + i, 0.0, 0.0),App.Vector(0.0, -200.0, 0.0))
File "/usr/local/Mod/Draft/Draft.py", line 685, in makeDimension
normal = App.Vector(0,0,1)
NameError: global name 'App' is not defined
Code: Select all
annoTxt = Draft.makeText(i,point=App.Vector(pergolaLongueur + 2200 + pergolaHauteur, pergolaLargeur + 800 + pergolaHauteur-curseur,0.0))
File "/usr/local/Mod/Draft/Draft.py", line 893, in makeText
if not screen: obj.ViewObject.DisplayMode="World"
AttributeError: 'NoneType' object has no attribute 'DisplayMode'
Formations - Assistance - Développement : https://freecad-france.com
Re: Error when importing Arch module
Between r3727 et r3792 something have changed.
In 3727 makeStructure create a visible object.
In 3792 makeStructure create a hidden object, I have to open it with FreeCAD gui and changed value manually in property editor to refresh the model. And I get some error at the opening(if Arch WB is not load).
The file made with FreeCADCmd
It seem that if there is base object, there is no problem.
In 3727 makeStructure create a visible object.
In 3792 makeStructure create a hidden object, I have to open it with FreeCAD gui and changed value manually in property editor to refresh the model. And I get some error at the opening(if Arch WB is not load).
Code: Select all
FreeCADCmd
FreeCAD 0.15, Libs: 0.15R3792 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> App.newDocument("Sans nom")
<Document object at 0x2480c50>
>>> App.setActiveDocument("Sans_nom")
>>> doc = App.ActiveDocument
>>> import Arch
>>> Arch.makeStructure(length=1000.0, width=100.0, height=100.0, name="Poutre")
<FeaturePython object at 0x2b37868>
>>> doc.recompute()
make ordering:
Poutre dep on: Recompute
Solv: Executing Feature: Poutre
>>> doc.saveAs(str("Test.fcstd"))
>>>
Formations - Assistance - Développement : https://freecad-france.com
Re: Error when importing Arch module
Okay all these issues should be fixed now...
Re: Error when importing Arch module
Thank you Yorik !yorik wrote:Okay all these issues should be fixed now...
I have a problem with dimensions
Code: Select all
buildWithOutGUI/bin$ ./FreeCADCmd
FreeCAD 0.15, Libs: 0.15R3817 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2011
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> import Draft
>>> import Arch
>>> App.newDocument("Sans nom")
<Document object at 0x22cb800>
>>> App.setActiveDocument("Sans_nom")
>>> App.ActiveDocument=App.getDocument("Sans_nom")
>>> import Draft
>>> Draft.makeDimension(FreeCAD.Vector(-0.0912128388882,0.225349321961,0.0),FreeCAD.Vector(2.41445708275,0.300465762615,0.0),FreeCAD.Vector(2.31251335144,0.858473658562,0.0))
Traceback (most recent call last):
File "/home/jo/Logiciels/FreeCAD/free-cad-code/buildWithOutGUI/Mod/Draft/Draft.py", line 3001, in onChanged
obj.setEditorMode('Distance',1)
<type 'exceptions.AttributeError'>: Property container has no property 'Distance'
<Document object>
>>> App.getDocument("Sans_nom").saveAs('/home/jo/Documents/FreeCAD/Cote.fcstd')
>>>
Formations - Assistance - Développement : https://freecad-france.com
Re: Error when importing Arch module
Hm I get a different error here, but it looks like there is a bug somewhere. When running FreeCAD in console mode, although objects have a "ViewObject" attribute (that should contain None IIRC), there is an error when you try to read it:
I'll see if I can fix it, otherwise I'll call for Werner's powers
Code: Select all
>>> doc = FreeCAD.newDocument()
>>> FreeCAD.ActiveDocument
<Document object at 0xfa8b10>
>>> obj = doc.addObject("App::FeaturePython","Test")
>>> obj
<FeaturePython object at 0x10557e8>
>>> obj.ViewObject
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getDocument'
Re: Error when importing Arch module
Ok this should be solved now!