-
Notifications
You must be signed in to change notification settings - Fork 57
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
[BUG] __getitem__ and __iter__ accessing wrong .Item methods #195
Comments
Addressed in #196 |
Whilst technically it should be This works fine: from pycatia import catia
from pycatia.mec_mod_interfaces.part_document import PartDocument
caa = catia()
part_document = PartDocument(caa.active_document.com_object)
part = part_document.part
for r in list(part.relations):
print(r) |
I see. I am using a variant of the Dispatch class which returns a win32com.client.DispatchBaseClass object. Here the attribtues are case sensitive. So that is causing the issues with me. I'm using the modified com interface provided by Dassault, which is part of the 3DX package. So it shouldn't break anything, if we'd use the "accurate" case sensitivity here. Then I would not have to manually update the files for other pc's when using pycatia. |
OK. Just wanted to understand why you were having issues as I was surprised this hadn't been raised before. |
Closing as 0.6.7 now has these changes implemented. |
Describe the bug
A bunch of classes access the wrong .item method in the com_objects.
They should be accessing .Item
This leads to errors when using the respective class as iterators (also in for loops) or accessing lists via the bracket operator.
To Reproduce
Try getting an item via bracket operator / using them in a for loop.
e.g.
for r in list(part.relations): ...
Expected behavior
Get the right element.
Screenshot

Example of the wrong code in pycatia/pycatia/knowledge_interfaces/relations.py
The text was updated successfully, but these errors were encountered: