Reading internal forces from CDB using Python

Hello everyone,
I am referring to the example " Single span girder". It can be found using the following link:

The marked line of code is not clear to me. Why are we testing that beam id equals 0?

Thank you in advance! :slight_smile:

Because the first two records are the max/min values of all beams and the beam id for these is 0.

Generally you need to loop through a record (e.g. 102/1001) line by line until you find what you want.
If you were looking for a specific beam section you would use that id instead.

However I think it should be changed to 0, since the beam id is an integer not a float

You can check what is in the cdb by going to:
Home → Database tools → Database Information

Also check out the CDBASE help: Help → CDBASE Help

1 Like

Thank you for the response. It helped me understand the issue.

One more point: Why was that last parameter of the function py_sof_cdb_get() set as 1 in the above mentioned example?

Here you have to check the actual c/c++ functions in the cdbase help manual.

The last input for sof_cdb_get() is the position and a value >0 retrieves the next value in the database.

  • That means that in the first call (in the loop) you start at the beginning (top line).
    Outside of a loop you could use 0 as well (go to the beginning)
  • In every consecutive call you move to the next item in the record (the next line) by using 1.
1 Like