Arch: General cleaning and removal of fixtures tool (unused anyway)
This commit is contained in:
@@ -795,6 +795,7 @@ class _CommandCheck:
|
||||
|
||||
|
||||
class _CommandFixture:
|
||||
# OBSOLETE - To be removed
|
||||
"the Arch Fixture command definition"
|
||||
def GetResources(self):
|
||||
return {'Pixmap' : 'Arch_Fixture',
|
||||
@@ -826,4 +827,4 @@ FreeCADGui.addCommand('Arch_SelectNonSolidMeshes',_CommandSelectNonSolidMeshes()
|
||||
FreeCADGui.addCommand('Arch_RemoveShape',_CommandRemoveShape())
|
||||
FreeCADGui.addCommand('Arch_CloseHoles',_CommandCloseHoles())
|
||||
FreeCADGui.addCommand('Arch_Check',_CommandCheck())
|
||||
FreeCADGui.addCommand('Arch_Fixture',_CommandFixture())
|
||||
#FreeCADGui.addCommand('Arch_Fixture',_CommandFixture())
|
||||
|
||||
@@ -283,8 +283,6 @@ class Component:
|
||||
"Other shapes that are appended to this object")
|
||||
obj.addProperty("App::PropertyLinkList","Subtractions","Arch",
|
||||
"Other shapes that are subtracted from this object")
|
||||
obj.addProperty("App::PropertyLinkList","Fixtures","Arch",
|
||||
"Shapes or Meshes that are appended to this object without modifying its geometry")
|
||||
obj.Proxy = self
|
||||
self.Type = "Component"
|
||||
self.Subvolume = None
|
||||
@@ -300,16 +298,7 @@ class Component:
|
||||
self.Type = state
|
||||
|
||||
def onChanged(self,obj,prop):
|
||||
if prop == "Placement":
|
||||
# make fixtures move along with host
|
||||
if hasattr(obj,"Fixtures"):
|
||||
vo = obj.Shape.Placement.Base
|
||||
vn = obj.Placement.Base
|
||||
import DraftVecUtils
|
||||
if not DraftVecUtils.equals(vo,vn):
|
||||
delta = vn.sub(vo)
|
||||
for o in obj.Fixtures:
|
||||
o.Placement.move(delta)
|
||||
pass
|
||||
|
||||
def hideSubobjects(self,obj,prop):
|
||||
"Hides subobjects when a subobject lists change"
|
||||
|
||||
@@ -26,11 +26,12 @@ from FreeCAD import Vector
|
||||
from PyQt4 import QtCore,QtGui
|
||||
from DraftTools import translate
|
||||
|
||||
__title__="FreeCAD Wall"
|
||||
__title__="FreeCAD Window"
|
||||
__author__ = "Yorik van Havre"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
WindowPartTypes = ["Frame","Solid panel","Glass panel"]
|
||||
AllowedHosts = ["Wall","Structure"]
|
||||
|
||||
def makeWindow(baseobj=None,width=None,name=str(translate("Arch","Window"))):
|
||||
'''makeWindow(obj,[name]): creates a window based on the
|
||||
@@ -81,7 +82,7 @@ class _CommandWindow:
|
||||
sel = FreeCADGui.Selection.getSelection()
|
||||
if sel:
|
||||
obj = sel[0]
|
||||
if Draft.getType(obj) == "Wall":
|
||||
if Draft.getType(obj) in AllowedHosts:
|
||||
FreeCADGui.activateWorkbench("SketcherWorkbench")
|
||||
FreeCADGui.runCommand("Sketcher_NewSketch")
|
||||
FreeCAD.ArchObserver = ArchComponent.ArchSelectionObserver(obj,FreeCAD.ActiveDocument.Objects[-1],hide=False,nextCommand="Arch_Window")
|
||||
@@ -118,7 +119,7 @@ class _Window(ArchComponent.Component):
|
||||
obj.addProperty("App::PropertyStringList","WindowParts","Arch",
|
||||
str(translate("Arch","the components of this window")))
|
||||
obj.addProperty("App::PropertyDistance","HoleDepth","Arch",
|
||||
str(translate("Arch","The depth of the hole that this window makes in its host wall. Keep 0 for automatic.")))
|
||||
str(translate("Arch","The depth of the hole that this window makes in its host object. Keep 0 for automatic.")))
|
||||
self.Type = "Window"
|
||||
obj.Proxy = self
|
||||
|
||||
@@ -128,7 +129,7 @@ class _Window(ArchComponent.Component):
|
||||
self.execute(obj)
|
||||
elif prop == "HoleDepth":
|
||||
for o in obj.InList:
|
||||
if Draft.getType(o) == "Wall":
|
||||
if Draft.getType(o) in AllowedHosts:
|
||||
o.Proxy.execute(o)
|
||||
|
||||
def execute(self,obj):
|
||||
@@ -187,7 +188,7 @@ class _Window(ArchComponent.Component):
|
||||
obj.Shape = base
|
||||
|
||||
def getSubVolume(self,obj,plac=None):
|
||||
"returns a subvolume for cutting in a base wall"
|
||||
"returns a subvolume for cutting in a base object"
|
||||
|
||||
# getting extrusion depth
|
||||
base = None
|
||||
|
||||
@@ -73,7 +73,7 @@ class ArchWorkbench(Workbench):
|
||||
"Arch_Floor","Arch_Building","Arch_Site",
|
||||
"Arch_Window","Arch_Roof","Arch_Axis",
|
||||
"Arch_SectionPlane","Arch_Space","Arch_Stairs",
|
||||
"Arch_Add","Arch_Remove","Arch_Fixture"]
|
||||
"Arch_Add","Arch_Remove"]
|
||||
self.meshtools = ["Arch_SplitMesh","Arch_MeshToShape",
|
||||
"Arch_SelectNonSolidMeshes","Arch_RemoveShape",
|
||||
"Arch_CloseHoles","Arch_MergeWalls"]
|
||||
|
||||
Reference in New Issue
Block a user