diff --git a/cadquery/CQ.py b/cadquery/CQ.py index 7504b16..cc03f8b 100644 --- a/cadquery/CQ.py +++ b/cadquery/CQ.py @@ -298,6 +298,10 @@ class CQ(object): For now you can work around by creating a workplane and then offsetting the center afterwards. """ + if len(self.objects) > 1: + raise ValueError("Workplane cannot be created if more than" + " 1 object is selected.") + obj = self.objects[0] def _computeXdir(normal): diff --git a/tests/TestCadQuery.py b/tests/TestCadQuery.py index 975feca..e58b594 100644 --- a/tests/TestCadQuery.py +++ b/tests/TestCadQuery.py @@ -442,7 +442,7 @@ class TestCadQuery(BaseTest): c = CQ( makeUnitCube()) #the cube is the context solid self.assertEqual(6,c.faces().size()) #cube has six faces - r = c.faces().workplane().circle(0.125).extrude(0.5,True) #make a boss, not updating the original + r = c.faces('>Z').workplane().circle(0.125).extrude(0.5,True) #make a boss, not updating the original self.assertEqual(8,r.faces().size()) #just the boss faces self.assertEqual(8,c.faces().size()) #original is modified too