Arch: Fixes in IFC importer (spaces didn't import correctly)

This commit is contained in:
Yorik van Havre 2013-09-24 22:38:03 -03:00
parent 2424fc4c7c
commit 1497e8eaa4
3 changed files with 5 additions and 4 deletions

View File

@ -29,11 +29,11 @@ import FreeCAD,FreeCADGui,ArchComponent,ArchCommands,math,Draft
from DraftTools import translate
from PyQt4 import QtCore
def makeSpace(objects=None):
def makeSpace(objects=None,name="Space"):
"""makeSpace([objects]): Creates a space object from the given objects. Objects can be one
document object, in which case it becomes the base shape of the space object, or a list of
selection objects as got from getSelectionEx(), or a list of tuples (object, subobjectname)"""
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython","Space")
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython",name)
_Space(obj)
_ViewProviderSpace(obj.ViewObject)
if objects:
@ -44,6 +44,7 @@ def makeSpace(objects=None):
objects[0].ViewObject.hide()
else:
obj.Proxy.addSubobjects(obj,objects)
return obj
def addSpaceBoundaries(space,subobjects):
"""addSpaceBoundaries(space,subobjects): adds the given subobjects to the given space"""

View File

@ -124,7 +124,6 @@ class _Window(ArchComponent.Component):
self.createGeometry(obj)
def onChanged(self,obj,prop):
print prop
self.hideSubobjects(obj,prop)
if prop in ["Base","WindowParts"]:
self.createGeometry(obj)

View File

@ -464,8 +464,9 @@ def makeSpace(entity,shape=None,name="Space"):
body = FreeCAD.ActiveDocument.addObject("Part::Feature",name+"_body")
body.Shape = shape
space.Base = body
body.ViewObject.hide()
if DEBUG: print "made space object ",entity,":",space
return site
return space
except:
return None