Load cases using python interface

  • My first question is where can I find list of all loadcases in the CDB? like below image.

I can see the loadcases information in CDB information , but can I get them as list?
image

  • Anyone help me how to loop through all the LCs and get beam forces for each LC? When I used the below code I am getting only for first load case i.e 2125. I want for all the LCs in list.
ie = c_int(0)
beamForces = {'beam':[],'LC':[],'Grp':[], 'VZ':[], 'MY':[]}
LC = [2125,2126,2425,2426,2129,2130,2429,2430]
for lc in LC:
   print(lc)
   while ie.value < 2:
      datalen.value = sizeof(CBEAM_FOC)
      RecLen = c_int(sizeof(cbeam_foc))
      ie.value = py_sof_cdb_get(Index, 102, lc, byref(cbeam_foc), byref(RecLen), 1)
      beamForces['beam'].append(cbeam_foc.m_id)
      beamForces['VZ'].append(cbeam_foc.m_vz)
      beamForces['MY'].append(cbeam_foc.m_my)
      beamForces['LC'].append(lc)
      
      # Always read the length of record before sof_cdb_get is called
      RecLen = c_int(sizeof(cbeam_foc))

@sfr @asiloisad @JFH

Thanks in advance!!

I got solution for second question i.e How to loop through LCs

beamForces = {'beam':[],'LC':[],'Grp':[], 'VZ':[], 'MY':[]}
LC = [2125,2126,2425,2426,2129,2130,2429,2430]
for lc in LC:
   ie = c_int(0)
   while ie.value < 2:
      datalen.value = sizeof(CBEAM_FOC)
      RecLen = c_int(sizeof(cbeam_foc))
      ie.value = py_sof_cdb_get(Index, 102, lc, byref(cbeam_foc), byref(RecLen), 1)
      beamForces['beam'].append(cbeam_foc.m_id)
      beamForces['VZ'].append(cbeam_foc.m_vz)
      beamForces['MY'].append(cbeam_foc.m_my)
      beamForces['LC'].append(lc)

   # Always read the length of record before sof_cdb_get is called
   RecLen = c_int(sizeof(cbeam_foc))

Can someone provide comments for first question. i.e How to get list of LCs from CDB?

Hello,

with

+prog sofiload urs:51.1
head
echo act full
end

you can generate a list of the actions and loadcases for the report browser output.

Kind regards,
Nora Weber
SOFiSTiK Support Team

Please excuse me, I am new to sofistik, I don’t understand what you are saying.

Could you please give some clarity? Are you talking about python code or teddy code?

I’m talking about teddy code :wink:

BR,
Nora