如何访问pyautocad中的块参考属性

问题描述 投票:0回答:1
from pyautocad import Autocad acad = Autocad() for obj in acad.iter_objects(['Block']): if obj.HasAttributes: obj.GetAttributes()

但它引发了异常
comTypesutomation.py,第457行,in _get_value typ = _vartype_to_ctype [self.vt&〜vt_array] keyError:9


如何使用pyautocad读取Autocad中的BOM。 light pyautocad存储库中的每个发行版,

https://github.com/reclosedev/pyautocad/issues/6

comtypes与访问阵列有关。 因此,要读取块参考,我们必须使用win32com如下:

python autocad
1个回答
2
投票

有关更多详细信息,您可以看到https://gist.github.com/thengineer/7157510.

这个线程可能已经死了,但是我想知道是否可以读取Win32COM的块属性。我尝试了一切,到目前为止什么都没有。

我发现能够插入块并更改其属性的唯一方法是将win32com用于插入和comtypes进行读取/更改属性,所有这些都以同一脚本为单位,这不是我知道的最佳选择。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.