diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index cefb65ac6..e3fe9a31f 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -364,7 +364,7 @@ def getCutVolume(cutplane,shapes): u = p.Vertexes[1].Point.sub(p.Vertexes[0].Point).normalize() v = u.cross(ax) if not bb.isCutPlane(ce,ax): - FreeCAD.Console.PrintMessage(translate("Arch","No objects are cut by the plane\n")) + #FreeCAD.Console.PrintMessage(translate("Arch","No objects are cut by the plane\n")) return None,None,None else: corners = [FreeCAD.Vector(bb.XMin,bb.YMin,bb.ZMin), diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index f8468ec6d..04936731b 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -1268,24 +1268,25 @@ def getRepresentation(ifcfile,context,obj,forcebrep=False,subtraction=False,tess tostore = False # check for clones - for k,v in clones.items(): - if (obj.Name == k ) or (obj.Name in v): - if k in sharedobjects: - # base shape already exists - repmap = sharedobjects[k] - pla = obj.Placement - axis1 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(1,0,0)))) - axis2 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(0,1,0)))) - axis3 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(0,0,1)))) - origin = ifcfile.createIfcCartesianPoint(tuple(FreeCAD.Vector(pla.Base).multiply(0.001))) - transf = ifcfile.createIfcCartesianTransformationOperator3D(axis1,axis2,origin,1.0,axis3) - mapitem = ifcfile.createIfcMappedItem(repmap,transf) - shapes = [mapitem] - solidType = "MappedRepresentation" - shapetype = "clone" - else: - # base shape not yet created - tostore = k + if not subtraction: + for k,v in clones.items(): + if (obj.Name == k ) or (obj.Name in v): + if k in sharedobjects: + # base shape already exists + repmap = sharedobjects[k] + pla = obj.Placement + axis1 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(1,0,0)))) + axis2 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(0,1,0)))) + axis3 = ifcfile.createIfcDirection(tuple(pla.Rotation.multVec(FreeCAD.Vector(0,0,1)))) + origin = ifcfile.createIfcCartesianPoint(tuple(FreeCAD.Vector(pla.Base).multiply(0.001))) + transf = ifcfile.createIfcCartesianTransformationOperator3D(axis1,axis2,origin,1.0,axis3) + mapitem = ifcfile.createIfcMappedItem(repmap,transf) + shapes = [mapitem] + solidType = "MappedRepresentation" + shapetype = "clone" + else: + # base shape not yet created + tostore = k if (not shapes) and (not forcebrep): profile = None diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index 6e77a2e73..29143d882 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -2478,6 +2478,10 @@ def clone(obj,delta=None): cl.Label = prefix + base.Label cl.CloneOf = base cl.Placement = obj[0].Placement + try: + cl.Role = base.Role + except: + pass return cl else: cl = FreeCAD.ActiveDocument.addObject("Part::AttachableObjectPython","Clone")