Hello,
This is my code for reading the free point load:
for LC in range(10000,10000+1):
if py_sof_cdb_kexist(12, LC) == 2: # the key exists and contains data 12:global load 10000: LC 10000-10233
ie = c_int(0)
RecLen = c_int(sizeof(clc_poin))
ie.value = py_sof_cdb_get(Index, 12, LC, byref(clc_poin), byref(RecLen), 1)
#lpt = clc_poin.m_lpt
p = clc_poin_lpt.m_p
x = clc_poin_lpt.m_x
RecLen = c_int(sizeof(clc_poin))
A similar code already works for reading another variable (rpar) but as rpar is a list and not a float it’s not completly comparable. I’ve checked print(ie.value)
and it says 1. So the size of the data does not fit. Reading sofistik_daten I was wondering:
- How m_p,m_x,m_y and m_z can be adressed correctly as lpt in clc_poin is an array of them (clc_poin_lpt)?
- How I can get the right datatype or size for reading the values?
Here is the code from sofistik_daten which I import in my file:
class CLC_POIN_LPT(Structure): # loadpt
_fields_ = [
('m_p', c_float),
('m_x', c_float), # [1001]
('m_y', c_float), # [1001]
('m_z', c_float) # [1001]
]
clc_poin_lpt = CLC_POIN_LPT()
class CLC_POIN(Structure): # 12/LC:10? Free point loads
_fields_ = [
('m_kref', c_int), # Reference type
('m_nref', c_int), # Reference number
('m_tref', c_int * 3), # Reference text (12 characters)
('m_typ', c_int), # type of load
('m_txt', c_int * 3), # Identifiying Text (12 characters)
('m_prz', c_float), # [ 8] Percentage of load covered with elements
('m_width', c_float), # [1001] Tolerance load direction to match elements
('m_lpt', CLC_POIN_LPT) # loadpt
]
clc_poin = CLC_POIN()