BoundBox: fix #3 - error message for wrong selection

This commit is contained in:
DeepSOIC 2016-04-03 21:44:37 +03:00
parent fbb613e131
commit 947a4da65a

View File

@ -298,9 +298,9 @@ def cmdSingleBoundBox():
FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.commitTransaction()
else: else:
raise SelectionError("Bad selection", raise SelectionError("Bad selection",
"Please select some shapes to make bounding boxes of, or a shape and a placement to make a rotated bounding box. You have selected %1 objects and %2 placements/arrays." "Please select some shapes to make bounding boxes of, or a shape and a placement to make a rotated bounding box. You have selected {shapescount} objects and {latticescount} placements/arrays."
.replace("%1",len(shapes)) .format( shapescount= str(len(shapes)),
.replace("%2",len(lattices)) latticescount= str(len(lattices)) )
) )
deselect(sel) deselect(sel)
@ -321,9 +321,9 @@ def cmdMultiBoundBox():
FreeCAD.ActiveDocument.commitTransaction() FreeCAD.ActiveDocument.commitTransaction()
else: else:
raise SelectionError("Bad selection", raise SelectionError("Bad selection",
"Please select some shapes to make bounding boxes of, or a shape and a placement to make a rotated bounding box. You have selected %1 objects and %2 placements/arrays." "Please select some shapes to make bounding boxes of, or a shape and a placement to make a rotated bounding box. You have selected {shapescount} objects and {latticescount} placements/arrays."
.replace("%1",len(shapes)) .format( shapescount= str(len(shapes)),
.replace("%2",len(lattices)) latticescount= str(len(lattices)) )
) )
deselect(sel) deselect(sel)