Arch: Fixed moving and rotating spaces
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user