Discrepancy while reading CDB using python

Hello everyone,

I hope this message finds you well. I have been utilizing the CDB Python interface for the past five months and recently encountered an issue while trying to retrieve spring numbers and their node numbers.

Although the CDB information shows 134 springs, my Python output is displaying 135. I have noticed that the last spring is repeated twice. Has anyone else experienced this issue or have any thoughts on how to resolve it?

Thank you in advance for your help.

CDB

Python

You need to break out of the loop or restructure it.
When you have read the last spring, the return value is less than 2.
Then you jump into the loop again read the spring (fails, values not updated) and append again.

Surround your append statements in the loop with an “if ie.value < 2:” is how I would do it

1 Like