Arch: bugfixes in IFC exporter

This commit is contained in:
Yorik van Havre
2018-07-26 19:23:48 -03:00
parent c28f95d9f5
commit e45a3674f0
4 changed files with 18 additions and 3 deletions

View File

@@ -583,7 +583,7 @@ class Component:
if hasattr(obj.Axis.Proxy,"getPoints"):
points = obj.Axis.Proxy.getPoints(obj.Axis)
if not points:
if obj.Axis.isDerivedFrom("Part.Feature"):
if obj.Axis.isDerivedFrom("Part::Feature"):
points = [v.Point for v in obj.Axis.Shape.Vertexes]
if points:
shps = []

View File

@@ -2309,6 +2309,10 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess
# base shape not yet created
tostore = k
# unhandled case: object is duplicated because of Axis
if obj.isDerivedFrom("Part::Feature") and (len(obj.Shape.Solids) > 1) and hasattr(obj,"Axis") and obj.Axis:
forcebrep = True
if (not shapes) and (not forcebrep):
profile = None
ev = FreeCAD.Vector()

View File

@@ -640,8 +640,10 @@ def findClosest(basepoint,pointslist):
in a list of 3d points, finds the closest point to the base point.
an index from the list is returned.
'''
if not pointslist: return None
smallest = 100000
npoint = None
if not pointslist:
return None
smallest = 1000000
for n in range(len(pointslist)):
new = basepoint.sub(pointslist[n]).Length
if new < smallest:

View File

@@ -4918,6 +4918,10 @@ class ShowSnapBar():
class Draft_Clone(Modifier):
"The Draft Clone command definition"
def __init__(self):
Modifier.__init__(self)
self.moveAfterCloning = False
def GetResources(self):
return {'Pixmap' : 'Draft_Clone',
'Accel' : "C,L",
@@ -4950,6 +4954,11 @@ class Draft_Clone(Modifier):
FreeCADGui.Selection.addSelection(FreeCAD.ActiveDocument.Objects[-(1+i)])
self.finish()
def finish(self,close=False):
Modifier.finish(self,close=False)
if self.moveAfterCloning:
todo.delay(FreeCADGui.runCommand,"Draft_Move")
class ToggleGrid():
"The Draft ToggleGrid command definition"