Draft: fixed obj.TypeId output after utils.get_type() change
. .
This commit is contained in:
committed by
Yorik van Havre
parent
e78b104a75
commit
41f81b2cff
@@ -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:
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user