Arch: Fixed moving and rotating spaces

This commit is contained in:
Yorik van Havre
2017-05-25 10:46:52 -03:00
parent de4d33cb84
commit 47f4e8072e
3 changed files with 8 additions and 4 deletions

View File

@@ -314,6 +314,8 @@ class _Space(ArchComponent.Component):
import Part
shape = None
faces = []
pl = obj.Placement
#print("starting compute")
# 1: if we have a base shape, we use it
@@ -372,6 +374,8 @@ class _Space(ArchComponent.Component):
#print("setting objects shape")
shape = shape.Solids[0]
obj.Shape = shape
pl = pl.multiply(obj.Placement)
obj.Placement = pl
return
print("Arch: error computing space boundary")

View File

@@ -333,7 +333,7 @@ def shapify(obj):
FreeCAD.ActiveDocument.recompute()
return newobj
def getGroupContents(objectslist,walls=False,addgroups=False):
def getGroupContents(objectslist,walls=False,addgroups=False,spaces=False):
'''getGroupContents(objectlist,[walls,addgroups]): if any object of the given list
is a group, its content is appened to the list, which is returned. If walls is True,
walls and structures are also scanned for included windows or rebars. If addgroups
@@ -357,7 +357,7 @@ def getGroupContents(objectslist,walls=False,addgroups=False):
# skip if the group is a page
newlist.append(obj)
else:
if addgroups:
if addgroups or (spaces and (getType(obj) == "Space")):
newlist.append(obj)
newlist.extend(getGroupContents(obj.Group,walls,addgroups))
else:

View File

@@ -2270,7 +2270,7 @@ class Move(Modifier):
onlyarchgroups = False
if not onlyarchgroups:
# arch groups can be moved, no need to add their children
self.sel = Draft.getGroupContents(self.sel)
self.sel = Draft.getGroupContents(self.sel,spaces=True)
self.ui.pointUi(self.name)
self.ui.modUi()
self.ui.xValue.setFocus()
@@ -2426,7 +2426,7 @@ class Rotate(Modifier):
def proceed(self):
if self.call: self.view.removeEventCallback("SoEvent",self.call)
self.sel = FreeCADGui.Selection.getSelection()
self.sel = Draft.getGroupContents(self.sel)
self.sel = Draft.getGroupContents(self.sel,spaces=True)
self.step = 0
self.center = None
self.ui.arcUi()