Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_dictionary feils with Invalid DXF attribute "hande" for entity DICTIONARY #751

Closed
gyanev opened this issue Oct 10, 2022 · 1 comment
Closed

Comments

@gyanev
Copy link

gyanev commented Oct 10, 2022

Describe the bug

When calling add_dictionary for a new extension dictionaly of any graphical element:

pl = modelspace.add_polyline2d(polyline,  dxfattribs={'layer':line_layer})
xdict = pl.new_extension_dict()
adict = xdict.add_dictionary("adictname")

the following exception is trown:

  File "/home/yanev/projects/pd/pd-flow/.venv/lib/python3.8/site-packages/ezdxf/entities/xdict.py", line 191, in add_dictionary
    owner=dictionary.dxf.hande,
  File "/home/yanev/projects/pd/pd-flow/.venv/lib/python3.8/site-packages/ezdxf/entities/dxfns.py", line 134, in __getattr__
    raise const.DXFAttributeError(
ezdxf.lldxf.const.DXFAttributeError: Invalid DXF attribute "hande" for entity DICTIONARY

To Reproduce
Just call add_dictionary of extension dictionary.

Expected behavior
A dictionary object should be successfully created and returned.

@gyanev
Copy link
Author

gyanev commented Oct 10, 2022

Actually while describing the issue I just realized that this is just a typo in ezdxf/entities/xdict.py in add_dictionary function. Line 191
owner=dictionary.dxf.hande,
should be
owner=dictionary.dxf.handle,

I just tested this change locally and it works fine.

@mozman mozman closed this as completed in 289d932 Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant