shape.RotationAngle
旋转角度(度),绕 RotationCenterX/Y 转。
签名
shape.RotationAngle
说明
旋转角度(度),绕
RotationCenterX/Y 转。Python 示例(可直接运行)
Python
shape = app.ActiveSelectionRange(1)
print("当前角度:", shape.RotationAngle) # 单位:度
shape.RotationAngle = 15 # 绕旋转中心转 15 度
print("旋转后:", shape.RotationAngle)
关于本类:Shape 几何与变换
位置、尺寸、旋转、包围盒。全部跟随 doc.Unit(你的环境是英寸),字号例外。
- 本类共 17 条,这是其中之一。
- 完整分类见:Shape 几何与变换
同类其他接口
- shape.Left / .Top / .Right / .Bottom四边坐标。Top > Bottom(Y 轴向上)。群组内部的子对象读不到,得用 GetBoundingBox。
- shape.PositionX / .PositionY左下角坐标,直接读写比 SetPosition 少一层调用。
- shape.SizeWidth / .SizeHeight宽度 / 高度,读写。缩放时先读原尺寸再按比例算新尺寸。
- shape.CenterX / .CenterY中心点坐标,定位对齐时比 Left/Top 好用。
- shape.SetPosition(x, y, anchor)移动。默认锚点是左下角,第 3 个参数可指定锚点。代码里 img.SetPosition((w - img.SizeWidth)/2, (h
- shape.SetSize(w, h, anchor)缩放,默认锚点左上。等比例缩放要自己算:s = max(W/ow, H/oh); img.SetSize(ow*s, oh*s)。
- shape.Move(dx, dy)相对位移,比 SetPosition 省一次读坐标。
- shape.Rotate(angle)相对旋转指定角度。