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
68 stars 27 forks source link

BUG: Excessive Node results #392

Closed cslotboom closed 2 months ago

cslotboom commented 2 months ago

Describe the bug Results for node supports from seem to kick out duplicates. In the code below I request data from one load combo (combo 9), and would expect to receive one results, instead multiple.

To Reproduce Run the code below on a model.

Model(False, "test.rf6")
Model.clientModel.service.begin_modification("new")

nodes = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_NODE, Model)

output = []
for node in nodes:
    output.append(ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 9, int(node)))

Model.clientModel.service.finish_modification()
Model.clientModel.service.close_connection()

Screenshots image

image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

heetrojivadiya commented 2 months ago

Hello @cslotboom,

Thank you for reaching to us. I have tested your issue. You are trying to get results one by one node. The result Table method give complete table as shown in RFEM. For example, if you assign node 1 to fetching the result table, it will provide a complete table like the picture below.

image

So, for the first row you can append table row with 0 index like ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 9, 1)[0]

So, the corrected code for your request is as below:

from RFEM.Tools.GetObjectNumbersByType import GetObjectNumbersByType
from RFEM.Results.resultTables import ResultTables
from RFEM.enums import *

Model(False, 'test')

Model.clientModel.service.begin_modification("new")

nodes = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_NODE, Model)

output = []
for node in [1]:
    result = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, int(node))
    if len(result) != 0:
        output.append(result[0])

Model.clientModel.service.finish_modification()
Model.clientModel.service.close_connection()

for item in output:
    print(item)

Let us know if you still face any issue.