dlubal-software / RFEM_Python_Client

Python client (or high-level functions) for RFEM 6 using Web Services, SOAP and WSDL
https://dlubal-software.github.io/.github/
MIT License
71 stars 27 forks source link

BUG: Issues reading results using the ResultTables() class #284

Closed Dervis-vL closed 1 year ago

Dervis-vL commented 1 year ago

Describe the bug When getting results from the model after calculation via the ResultTable class, an error occurs in the GetResultTableParameters() function.

The object apears to be of the correct type when <suds.sudsobject.array_of_.....> gets passed as the variable in the results argument of the function.

The params 'no', 'description', 'row' are found. The error states that i.row.__keylist__ does not have the attribute keylist.

The error message:

AttributeError                            Traceback (most recent call last)
Cell In[19], line 1
----> 1 print(ConvertResultsToListOfDct(test_model.operator.model.clientModel.service.get_results_for_members_internal_forces(CaseObjectType.E_OBJECT_TYPE_RESULT_COMBINATION.name, 1, 0)))

File d:\Users\LEED\AppData\Local\pypoetry\Cache\virtualenvs\traffic-bridge-tool-ToYKuhA6-py3.10\lib\site-packages\RFEM\Results\resultTables.py:39, in ConvertResultsToListOfDct(results, includeBase)
     36 if not results:
     37     return ''
---> 39 params = GetResultTableParameters(results)
     40 lstOfDct = []
     42 for r in results[0]:

File d:\Users\LEED\AppData\Local\pypoetry\Cache\virtualenvs\traffic-bridge-tool-ToYKuhA6-py3.10\lib\site-packages\RFEM\Results\resultTables.py:22, in GetResultTableParameters(results)
     20 params['base'] = list(set(params['base'] + i.__keylist__))
     21 if 'row' in i.__keylist__:
---> 22     params['row'] = list(set(params['row'] + i.row.__keylist__))
     23 else:
     24     params['errors'] = "Result table doesn't have attribute 'row'."

AttributeError: 'Text' object has no attribute '__keylist__'

The error message appears on all types of getting results that I have tried: ResultTables.SurfacesDesignInternalForces() ResultTables.SurfacesPrincipalInternalForces() ResultTables.MembersInternalForces() ResultTables.NodesSupportForces()

To Reproduce Steps to reproduce the behavior:

  1. Create RFEM 6 model
  2. Add loads on the model
  3. Create 3 result combinations
  4. model.clientModel.service.finish_modification()
  5. Calculate_all(model=Model)
  6. results = ResultTables.NodesSupportForces(loading_type=CaseObjectType.E_OBJECT_TYPE_RESULT_COMBINATION, loading_no=1, object_no=0, include_base=True, model=Model)
  7. See error message

Expected behavior Results from the calculated model.

Screenshots

(array_of_surfaces_design_internal_forces){
   surfaces_design_internal_forces[] = 
      (surfaces_design_internal_forces_row){
         no = 1
         description = "1"
         row = 
            (surfaces_design_internal_forces){
               grid_point = 
                  (variant){
                     type = 2
                     value = "1"
                  }
               grid_point_coordinate_x = 
                  (variant){
                     type = 0
                     value = "0"
                  }
               grid_point_coordinate_y = 
                  (variant){
                     type = 0
                     value = "0"
                  }
               grid_point_coordinate_z = 
                  (variant){
                     type = 0
                     value = "0"
                  }
               layer = 1
               design_internal_force_label = 
                  (variant){
                     type = 3
                     value = "max"
                  }
               moment_mx_d_plus = 
                  (variant){
                     type = 0
                     value = "325505.3125"
                  }
               moment_my_d_plus = 
                  (variant){
                     type = 0
                     value = "385527.125"
                  }
               moment_mc_d_plus = 
                  (variant){
                     type = 0
                     value = "-129206.1953125"
                  }
               moment_mx_d_minus = 
                  (variant){
                     type = 0
                     value = "2143023.25"
                  }
               moment_my_d_minus = 
                  (variant){
                     type = 0
                     value = "122564.828125"
                  }
               moment_mc_d_minus = 
                  (variant){
                     type = 0
                     value = "-44777.85546875"
                  }
               axial_force_nx_d = 
                  (variant){
                     type = 0
                     value = "683481.875"
                  }
               axial_force_ny_d = 
                  (variant){
                     type = 0
                     value = "865573.375"
                  }
               axial_force_nc_d = 
                  (variant){
                     type = 0
                     value = "-138398.859375"
                  }
               specification = None
            }
      },

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

OndraMichal commented 1 year ago

Hi @Dervis-vL, I believe this was corrected 25.8. (199515e476b3fb0d55bfd6cc5af722dc82fa78ae) in the main branch. So using latest version of the repo should fix it.

Dervis-vL commented 1 year ago

For this specific issue, rfem package 1.18.0 seems to cover the fix, and works for me.