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

BUG: SUDS.TypeNotFound: Type not found: 'line' #334

Closed Jeroen124 closed 8 months ago

Jeroen124 commented 8 months ago

I have tried to run API modifictions on python 3.11.3 and on 3.11.7 with all dependencies installed.

When trying to run my own code (Which ran with RSTAB api) I now get the following error:

  File "C:\Python311\Lib\site-packages\suds\mx\literal.py", line 87, in start
    raise TypeNotFound(content.tag)
suds.TypeNotFound: Type not found: 'line'

I have tried running the simple cantilever example:

from RFEM.Calculate.meshSettings import GetModelInfo
from RFEM.Loads.nodalLoad import NodalLoad
from RFEM.LoadCasesAndCombinations.loadCase import LoadCase
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
from RFEM.TypesForNodes.nodalSupport import NodalSupport
from RFEM.BasicObjects.member import Member
from RFEM.BasicObjects.node import Node
from RFEM.BasicObjects.section import Section
from RFEM.BasicObjects.material import Material
from RFEM.initModel import CalculateSelectedCases, Model
from RFEM.enums import NodalSupportType, NodalLoadDirection, ActionCategoryType
import os
import sys
baseName = os.path.basename(__file__)
dirName = os.path.dirname(__file__)
print('basename:    ', baseName)
print('dirname:     ', dirName)
sys.path.append(dirName + r'/../..')

if __name__ == '__main__':
    l = 3
    f = 2

    # 1. Model Initiation
    Model(new_model=True, model_name="SOLVINQ", delete_all=True)
    Model.clientModel.service.begin_modification("new")

    Material(1, 'S235')

    Section(1, 'IPE 200')

    Node(1, 0.0, 0.0, 0.0)
    Node(2, l, 0.0, 0.0)

    Member(1, 1, 2, 0.0, 1, 1)

    NodalSupport(1, '1', NodalSupportType.FIXED)

    StaticAnalysisSettings.GeometricallyLinear(1, "Linear")
    StaticAnalysisSettings.SecondOrderPDelta(2, "SecondOrder")
    StaticAnalysisSettings.LargeDeformation(3, "LargeDeformation")

    LoadCase.StaticAnalysis(
        1, 'Self-Weight', analysis_settings_no=1, self_weight=[True, 0.0, 0.0, 1.0])
    LoadCase.StaticAnalysis(2, 'Variable', analysis_settings_no=1,
                            action_category=ActionCategoryType.ACTION_CATEGORY_IMPOSED_LOADS_CATEGORY_B_OFFICE_AREAS_QI_B)

    NodalLoad(
        1, 1, '2', NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, f*1000)
    Model.clientModel.service.finish_modification()

    # Calculate_all()
    messages = CalculateSelectedCases([1])
    if len(messages) != 0:
        print("Calculation finished unsuccessfully")
        print(messages)
        # for message in messages:
        #     print("{0}\t{1}: {2} - {3} {4} {5}".format("Yes" if message.result else "No", message.message_type.ToString(), message.message, message.@object, message.current_value, message.input_field))
    else:
        print("Calculation finished successfully")

    # model status
    modelStatus = GetModelInfo()
    print("Model is calculated" if modelStatus.property_has_results else "Model is not calculated")
    print("Model contains printout report" if modelStatus.property_has_printout_report else "Model has not printout report")
    print("Model contains " + str(modelStatus.property_node_count) + " nodes")
    print("Model contains " + str(modelStatus.property_line_count) + " lines")
    print("Model contains " + str(modelStatus.property_member_count) + " members")
    print("Model contains " + str(modelStatus.property_surface_count) + " surfaces")
    print("Model contains " + str(modelStatus.property_solid_count) + " solids")
    print("Model contains " + str(modelStatus.property_lc_count) + " load cases")
    print("Model contains " +
          str(modelStatus.property_co_count) + " load combinations")
    print("Model contains " + str(modelStatus.property_rc_count) + " result classes")
    print("Model weight " + str(modelStatus.property_weight))
    print("Model dimension x " + str(modelStatus.property_dimensions.x))
    print("Model dimension y " + str(modelStatus.property_dimensions.y))
    print("Model dimension z " + str(modelStatus.property_dimensions.z))

    node = Model.clientModel.service.get_node(1)
    print("Node x coordinate " + str(node.coordinate_1))

    # ExportDetailsOfDesignToCSV(r"C:/WORK/TEMP/")

This resulted in the same error. I think it is a problem with the added optional line property of the member class?

Desktop (please complete the following information):

OndraMichal commented 8 months ago

Hi @Jeroen124, this looks like problem with caching of WSDL files. We cache them in order to speed the whole process. It is updated when WSDL is older than 24h. Go to c:\Users...\AppData\Local\Temp\WSDL\ and delete all. If the issue persist, let me know. This usualy happens when user is switching between multiple versions of RFEM in one day or as you did if from RSTAB goes to RFEM. RSTAB is basically reducted version of RFEM so then it doesn't know objects like lines.

Jeroen124 commented 8 months ago

@OndraMichal This resolved it! Thanks!