Moving shapes within a sketch after creation #744
Replies: 2 comments 3 replies
-
There are two important concepts as shown here: with BuildSketch() as sk:
r1 = Rectangle(1, 1)
with Locations((5, 5)):
r2 = Rectangle(2, 2)
with BuildSketch(Pos(5, 5)) as sk2:
r3 = Rectangle(1, 1)
r4 = Rectangle(2, 2) In In your "Example 2" Outside of the builder, sk.sketch.move(l) # relative move
sk.sketch.locate(l) # absolute move
sk.sketch.moved(l) # relative move with copy
sk.sketch.located(l) # absolute move with copy
sk.sketch.position = (x,y,z) # absolute move
sk.sketch.posiiton += (dx,dy,dz) # relative move |
Beta Was this translation helpful? Give feedback.
-
Also, many of these concepts are covered in the introductory examples https://build123d.readthedocs.io/en/latest/introductory_examples.html I highly recommend you spend time working through these examples as it will save you time in the long run. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to create a shape in a sketch (e.g., the default Plane.XY) and then move it?
For example, why do these two examples produce separate results:
vs
I understand that BuildSketch() initialises on the default Plane.XY. I assume then, that each shape that is placed on this plane is centred on the origin (by default). So example2:r2 is centred on (0,0). Why cannot it then be relocated on plane.XY to (5,5) using either
locate
ormove
?Beta Was this translation helpful? Give feedback.
All reactions