hexagon logo

PCL; res_db_create_subcase_c; How to specify the first argument?

Hello!
I am trying to write a script for results derivation and I have a problem with the first argument of function:
res_db_create_subcase_c( 2, "Demo", res_create_demo_scid, res_create_demo_rcid )
 
How to find the correct value? In all examples I have found it is hard coded. In my cases it is sometimes 6 or 7 (based on log output). What is meaning of this number?
  • It is the Loadcase ID, compare with function db_create_sub_case(lcid, title, scid, rcid )
     
     
  • Ok. is lcid a user input or it is a number that exists in the db? If this is a user input, why this code works for "6" but not for "10"? If it is a number that exists in db, how to find the correct value?:
     
    db_drop_res_index( )
    INTEGER res_create_demo_lcid
    res_db_create_loadcase_c( "rms_1s", 1, "Assign Results To A Load Case", res_create_demo_lcid )
    INTEGER res_create_demo_scid
    INTEGER res_create_demo_rcid
     
    res_db_create_subcase_c( 6, "ax", res_create_demo_scid, res_create_demo_rcid )
    res_data_load_dbresult( 0, "Nodal", "Scalar", "RMS", "ax", "Accelerations", "Tx-Basic", "(NON-LAYERED)", "", "", "", "", "", "", 0. )
    res_data_dbres_list( 0, "Nodal", "Scalar", 1, ["RMS"], ["ax"], [ "Accelerations"], ["Tx-Basic"], ["(NON-LAYERED)"] )
    res_data_list_sum( 0, "Nodal", "Scalar", 2, [1., 0.] )
    res_data_save( 0, "Nodal", "Scalar", "rms_1s", "ax", "(NON-LAYERED)", "Accelerations", "Tx-Basic" )
    res_data_load_dbresult( 0, "Nodal", "Scalar", "RMS", "ax", "Accelerations", "Ty-Basic", "(NON-LAYERED)", "", "", "", "", "", "", 0. )
    res_data_dbres_list( 0, "Nodal", "Scalar", 1, ["RMS"], ["ax"], [ "Accelerations"], ["Ty-Basic"], ["(NON-LAYERED)"] )
    res_data_list_sum( 0, "Nodal", "Scalar", 2, [1., 0.] )
    res_data_save( 0, "Nodal", "Scalar", "rms_1s", "ax", "(NON-LAYERED)", "Accelerations", "Ty-Basic" )
    res_data_load_dbresult( 0, "Nodal", "Scalar", "RMS", "ax", "Accelerations", "Tz-Basic", "(NON-LAYERED)", "", "", "", "", "", "", 0. )
    res_data_dbres_list( 0, "Nodal", "Scalar", 1, ["RMS"], ["ax"], [ "Accelerations"], ["Tz-Basic"], ["(NON-LAYERED)"] )
    res_data_list_sum( 0, "Nodal", "Scalar", 2, [1., 0.] )
    res_data_save( 0, "Nodal", "Scalar", "rms_1s", "ax", "(NON-LAYERED)", "Accelerations", "Tz-Basic" )
    db_post_results_load( )
  • two functions that are related:
    db_get_load_case_id
    db_get_load_case_title
     
    and to get all lcids
    res_utl_get_loadcases
  • I only answered the second question you had which was how to get the existing lcid. The lcid is created (returned in a function argument) when the loadcase is created, so it will then exist in the database.