Commit b2133fc0 authored by sumpfralle's avatar sumpfralle

report failure if the DXF file does not contain supported elements


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@385 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent 9e376df1
......@@ -207,13 +207,16 @@ def import_model(filename):
result = DXFParser(f)
lines = result.get_model()["lines"]
model = pycam.Geometry.Model.ContourModel()
for l in lines:
model.append(l)
print "Imported DXF model: %d lines" % len(lines)
return model
if lines:
model = pycam.Geometry.Model.ContourModel()
for l in lines:
model.append(l)
print "Imported DXF model: %d lines" % len(lines)
return model
else:
print >>sys.stderr, "No supported elements found in DXF file!"
return None
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment