[Python] How to access Block reference attributes in pyautocad

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    If Bill of Material (BOM) in AutoCAD drawing are in 'Block Reference', to read BOM using pyautocad we can read it using following code.

    from pyautocad import Autocad

    acad = Autocad()
    for obj in acad.iter_objects(['Block']):
    if obj.HasAttributes:
    obj.GetAttributes()


    But it throws exception in
    comtypes\automation.py, line 457, in _get_value typ = _vartype_to_ctype[self.vt & ~VT_ARRAY] KeyError: 9

    How to read BoM in AutoCAD using pyautocad.

    Continue reading...

Compartilhe esta Página