首页/ 接口索引/ 单位与换算

shape.Curve.Area / shape.Curve.Length

真实面积 / 周长,仅曲线对象有。

签名

shape.Curve.Area / shape.Curve.Length

说明

真实面积 / 周长,仅曲线对象有。

Python 示例(可直接运行)

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

try:
    c = shape.Curve                     # 只有曲线对象才有
    print("真实面积:", round(c.Area, 4))
    print("周长:", round(c.Length, 4))
except Exception:
    print("不是曲线,先 shape.ConvertToCurves() 再读")

关于本类:单位与换算

最容易出 25.4 倍错误的地方。先搞清楚 doc.Unit 是什么,再写数字。

同类其他接口