diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index a2d2a52fc8..ff3117bc7d 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -165,7 +165,7 @@ def joinWalls(walls,delete=False): if base.Base: if base.Base.Shape.Faces: return None - if Draft.getType(base.Base) == "Sketch": + if Draft.getType(base.Base) == "Sketcher::SketchObject": sk = base.Base else: sk = Draft.makeSketch(base.Base,autoconstraints=True) @@ -1017,7 +1017,7 @@ class _Wall(ArchComponent.Component): if Draft.getType(obj.Base) == "Wire": #print "modifying p2" obj.Base.End = p2 - elif Draft.getType(obj.Base) == "Sketch": + elif Draft.getType(obj.Base) == "Sketcher::SketchObject": try: obj.Base.movePoint(0,2,p2,0) except: diff --git a/src/Mod/Arch/importIFClegacy.py b/src/Mod/Arch/importIFClegacy.py index bd2ed2a1db..5f11ea33e8 100644 --- a/src/Mod/Arch/importIFClegacy.py +++ b/src/Mod/Arch/importIFClegacy.py @@ -1015,15 +1015,17 @@ def export(exportList,filename): # setting the IFC type if hasattr(obj,"Role"): ifctype = obj.Role.replace(" ","") + elif otype == "Foundation": + ifctype = "Footing" + elif otype == "Rebar": + ifctype = "ReinforcingBar" + elif otype == "Undefined": + ifctype = "BuildingElementProxy" + elif otype.startswith("Part::"): + ifctype = "BuildingElementProxy" else: ifctype = otype - if ifctype == "Foundation": - ifctype = "Footing" - elif ifctype == "Rebar": - ifctype = "ReinforcingBar" - elif ifctype in ["Part","Undefined"]: - ifctype = "BuildingElementProxy" - + # getting the "Force BREP" flag brepflag = False if hasattr(obj,"IfcAttributes"): @@ -1106,7 +1108,7 @@ def export(exportList,filename): extra = [obj.Width.Value*scaling, obj.Height.Value*scaling] elif otype == "Space": extra = ["ELEMENT","INTERNAL",getIfcElevation(obj)] - elif otype == "Part": + elif otype.startswith("Part::"): extra = ["ELEMENT"] if not ifctype in supportedIfcTypes: if DEBUG: print(" Type ",ifctype," is not supported yet. Exporting as IfcBuildingElementProxy instead") diff --git a/src/Mod/Draft/draftfunctions/offset.py b/src/Mod/Draft/draftfunctions/offset.py index 987a57c94e..fc1038677f 100644 --- a/src/Mod/Draft/draftfunctions/offset.py +++ b/src/Mod/Draft/draftfunctions/offset.py @@ -73,7 +73,7 @@ def offset(obj, delta, copy=False, bind=False, sym=False, occ=False): newwire = None delete = None - if utils.get_type(obj) in ["Sketch","Part"]: + if utils.get_type(obj).startswith("Part::") or utils.get_type(obj).startswith("Sketcher::"): copy = True print("the offset tool is currently unable to offset a non-Draft object directly - Creating a copy") diff --git a/src/Mod/Draft/draftguitools/gui_snapper.py b/src/Mod/Draft/draftguitools/gui_snapper.py index e73b035b27..ed71624741 100644 --- a/src/Mod/Draft/draftguitools/gui_snapper.py +++ b/src/Mod/Draft/draftguitools/gui_snapper.py @@ -446,11 +446,11 @@ class Snapper: snaps.extend(self.snapToEndpoints(edge)) snaps.extend(self.snapToIntersection(edge)) - elif Draft.getType(obj) == "Mesh": + elif Draft.getType(obj).startswith("Mesh::"): # for meshes we only snap to vertices snaps.extend(self.snapToEndpoints(obj.Mesh)) - elif Draft.getType(obj) == "Points": + elif Draft.getType(obj).startswith("Points::"): # for points we only snap to points snaps.extend(self.snapToEndpoints(obj.Points))