首页/ 接口索引/ Shape 几何与变换

shape.Move(dx, dy)

相对位移,比 SetPosition 省一次读坐标。

签名

shape.Move(dx, dy)

说明

相对位移,比 SetPosition 省一次读坐标。

Python 示例(可直接运行)

依赖 pywin32。示例假定 app / doc / page / layer 已就绪。 见「连接与初始化」
Python
shape = app.ActiveSelectionRange(1)
x0, y0 = shape.PositionX, shape.PositionY

shape.Move(10 / 25.4, 5 / 25.4)            # 相对位移:右移 10mm、上移 5mm

print("位移前:", x0, y0)
print("位移后:", shape.PositionX, shape.PositionY)

关于本类:Shape 几何与变换

位置、尺寸、旋转、包围盒。全部跟随 doc.Unit(你的环境是英寸),字号例外。

同类其他接口