- 论坛徽章:
- 0
|
安装上pythonwin32模块后,用Python连接上了AutoCAD,一些查询的方法和属性使用正常,也可以查询到实体的坐标,返回的坐标是Tuple类型的。但是在涉及到向CAD传输坐标的时候就会报错。
例如,在AutoCAD中加点的方法是object.AddPoint(Point) ,手册中对这个方法的Point参数是这样描述的:
Point:Variant (three-element array of doubles); input-only
The coordinates of the point to be created.
我无论把Point定义为Tuple、List、字符串类型,都无法通过,在网上也没查到结果,有哪位朋友能给我一些帮助吗?谢谢了。
错误信息是(Python3.01 + pywin32-213.win32-py3.0):
>>> ms.addpoint(pt)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<COMObject <unknown>>", line 2, in addpoint
pywintypes.com_error: (-2147352567, '发生意外。', (0, None, None, None, 0, -2147024809), None)
[ 本帖最后由 风雨中... 于 2009-4-21 17:42 编辑 ] |
|