evereux / pycatia

python module for CATIA V5 automation
MIT License
196 stars 53 forks source link

[BUG] Parameter .item method not working #197

Closed mokrueger closed 7 months ago

mokrueger commented 7 months ago

Describe the bug in pycatia/pycatia/knowledge_interfaces/parameters.py

The parameters.item will fail with Attribute error "... object has no attribute 'value'"

image

since the com_object will not have .value but .Value

To Reproduce Access parameters with .item

Expected behavior Get the proper item

mokrueger commented 7 months ago

Addressed in https://github.com/evereux/pycatia/pull/198

evereux commented 7 months ago

Again, I can't reproduce the issue here.

This works for me on a List type parameter.


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
parameters = part.parameters

print(parameters.item(2).value)

I do like what you've done coding wise though!

evereux commented 7 months ago

Closing as 0.6.7 now has these changes implemented.