Arch: Minor bugfixes
This commit is contained in:
parent
a085eede68
commit
155ae0ca41
|
@ -75,6 +75,14 @@ def removeComponents(objectsList,host=None):
|
||||||
objectsList = [objectsList]
|
objectsList = [objectsList]
|
||||||
if host:
|
if host:
|
||||||
if Draft.getType(host) in ["Wall","Structure"]:
|
if Draft.getType(host) in ["Wall","Structure"]:
|
||||||
|
if hasattr(host,"Axes"):
|
||||||
|
a = host.Axes
|
||||||
|
print a
|
||||||
|
for o in objectsList[:]:
|
||||||
|
print o.Name
|
||||||
|
if o in a:
|
||||||
|
a.remove(o)
|
||||||
|
objectsList.remove(o)
|
||||||
s = host.Subtractions
|
s = host.Subtractions
|
||||||
for o in objectsList:
|
for o in objectsList:
|
||||||
if not o in s:
|
if not o in s:
|
||||||
|
|
|
@ -80,7 +80,7 @@ def removeFromComponent(compobject,subobject):
|
||||||
it is added as a subtraction.'''
|
it is added as a subtraction.'''
|
||||||
if compobject == subobject: return
|
if compobject == subobject: return
|
||||||
found = False
|
found = False
|
||||||
attribs = ["Additions","Subtractions","Objects","Components","Base"]
|
attribs = ["Additions","Subtractions","Objects","Components","Base","Axes"]
|
||||||
for a in attribs:
|
for a in attribs:
|
||||||
if hasattr(compobject,a):
|
if hasattr(compobject,a):
|
||||||
if a == "Base":
|
if a == "Base":
|
||||||
|
|
|
@ -110,6 +110,12 @@ class _Structure(ArchComponent.Component):
|
||||||
pts.extend(DraftGeomUtils.findIntersection(e1,e2))
|
pts.extend(DraftGeomUtils.findIntersection(e1,e2))
|
||||||
return pts
|
return pts
|
||||||
|
|
||||||
|
def getAxisPlacement(self,obj):
|
||||||
|
"returns an axis placement"
|
||||||
|
if obj.Axes:
|
||||||
|
return obj.Axes[0].Placement
|
||||||
|
return None
|
||||||
|
|
||||||
def createGeometry(self,obj):
|
def createGeometry(self,obj):
|
||||||
import Part, DraftGeomUtils
|
import Part, DraftGeomUtils
|
||||||
|
|
||||||
|
@ -174,14 +180,21 @@ class _Structure(ArchComponent.Component):
|
||||||
if not hole.Shape.isNull():
|
if not hole.Shape.isNull():
|
||||||
base = base.cut(hole.Shape)
|
base = base.cut(hole.Shape)
|
||||||
hole.ViewObject.hide() # to be removed
|
hole.ViewObject.hide() # to be removed
|
||||||
|
|
||||||
|
# applying axes
|
||||||
pts = self.getAxisPoints(obj)
|
pts = self.getAxisPoints(obj)
|
||||||
|
apl = self.getAxisPlacement(obj)
|
||||||
if pts:
|
if pts:
|
||||||
fsh = []
|
fsh = []
|
||||||
for p in pts:
|
for p in pts:
|
||||||
sh = base.copy()
|
sh = base.copy()
|
||||||
|
if apl:
|
||||||
|
sh.Placement.Rotation = apl.Rotation
|
||||||
sh.translate(p)
|
sh.translate(p)
|
||||||
fsh.append(sh)
|
fsh.append(sh)
|
||||||
obj.Shape = Part.makeCompound(fsh)
|
obj.Shape = Part.makeCompound(fsh)
|
||||||
|
|
||||||
|
# finalizing
|
||||||
else:
|
else:
|
||||||
if base:
|
if base:
|
||||||
if not base.isNull():
|
if not base.isNull():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user