- 积分
- 126
- 明经币
- 个
- 注册时间
- 2023-9-15
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2025-7-16 18:33:09
|
显示全部楼层
我用的python的win32com库连接的cad,这两天用代码批量打印遇到了因为target的存在导致打印是空白,刚好也研究到这个问题了,我把我的代码发出来和大家交流一下:
def vtpnt(x, y, z=0):
"""坐标点转化为浮点数"""
return win32com.client.VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_R8, (x, y, z))
acad = win32com.client.Dispatch("ZWCAD.Application")
doc = acad.ActiveDocument
doc.ActiveViewport.Target=vtpnt(0,0,0) |
|