Coder Social home page Coder Social logo

dlubal-software / rstab_python_client Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 4.0 10.48 MB

Python client (or high-level functions) for RSTAB 9 using Web Services, SOAP, and WSDL

License: MIT License

Python 98.12% JavaScript 0.10% CSS 0.25% HTML 1.53%

rstab_python_client's Introduction

Dlubal Software

Dlubal Software GmbH

image image image image

image image image image Open Source? Yes! image

Welcome to RSTAB Python High Level Functions

Tutorial

Python client (high-level functions) for RSTAB 9 using Web Services (WS), SOAP and WSDL. Available Python SOAP pkgs can be found on wiki.python.org.

Description

This Python project is focused on opening RSTAB 9 to all of our customers, enabling them to interact with RSTAB 9 on a much higher level. If you are looking for a tool to help you solve parametric models or optimization tasks, you have come to the right place. This community serves as a support portal and base for all of your future projects. The goal is to create an easily expandable Python library, which communicates instructions to RSTAB 9 through WebServices (WS). WS enables access to RSTAB 9 either via a local instance or a remote internet connection.

Eyes on Upcoming Developmets! ๐Ÿ‘€

As you may have already heard, brand new WS features are in the works. Having support for Python scripting directly in the RSTAB, we have foundations to build completely new WS API which will be faster, have better access to results, and will have full compatibility with RSTAB Console.

Architecture

  • RSTAB: folder following the structure of RSTAB 9 navigator containing individual types of objects
  • initModel: runs after window and initializes suds.Client by connecting to http://localhost:8081/wsdl and activating model in RSTAB. It also envelops essential global functions.
  • enums: definition of enumerations

Getting started

Dependencies

Dependency check is implemented inside dependencies.py with option to install during execution.

Step by step

  1. ๐ŸŒ€ Clone this repository (if you have GitHub account) or download actual release

  2. RSTAB Open RSTAB 9 application

  3. โ˜‘๏ธ Check if there are no opened dialogues in RSTAB and server port range under Options-Web Services corresponds to the one set in initModel

  4. ๐Ÿƒ Run your script. Inspirations can be found in Examples or UnitTests.

Examples

The scripts are intended to be used as templates or examples. Also, they can be used for testing of backward compatibility.

Unit Tests

Collection of scripts used to support further development.

Python package ๐Ÿ“ฆ

The easiest way to enjoy the Client is to install current RSTAB package directly to your Python via pip install RSTAB. Especially if no code changes are required.

Documentation ๐Ÿ“š

For complete description of classes and functions visit our image.

Wiki

If you run into problems see our Wiki. We are slowly but surely expanding the solutions to the problems found in the Issues section.

License

License: MIT

Contribute

Contributions are always welcome!๐Ÿ™‚ Please ensure your pull request adheres to the following guidelines:

  • Alphabetize your entry.
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • Suggested READMEs should be beautiful or stand out in some way.
  • Make an individual pull request for each suggestion.
  • New categories, or improvements to the existing categorization are welcome.
  • Keep descriptions short and simple, but descriptive.
  • Start the description with a capital and end with a full stop/period.
  • Check your spelling and grammar.
  • Make sure your text editor is set to remove trailing whitespace.
  • Use the #readme anchor for GitHub READMEs to link them directly

โš ๏ธNOTE: Development is in early stages so please respect that. There will be broken objects or adjustments affecting backward compatibility. Use Issues section to point out any problems. Thank you for your understanding.

Connect with us ๐Ÿค

website ย ย  Youtube ย ย  Twitter ย ย  LinkedIn ย ย  Instagram ย ย  GitHub

Languages and Tools ๐Ÿ› ๏ธ

Visual Studio Code Python RFEM RSTAB GitHub Terminal

GitHub Stargazers over Time

Star History Chart

Contributors


Contributors

rstab_python_client's People

Contributors

aliciaknauer avatar dogukankaratas avatar heetrojivadiya avatar ondramichal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rstab_python_client's Issues

BUG: load_direction.name - AttributeError: 'int' object has no attribute 'name'

Describe the bug
When defining a MemberLoad there is an AttributeError raised as the class MemberLoad tries to read name field from enum (int) variable

To Reproduce
Create a sample construction with member loads, I used an example from https://github.com/Dlubal-Software/RFEM_Python_Client/blob/main/Examples/SteelDesign/SteelDesignExcel.py and changed it a little bit to work with RSTAB & no Excel

Expected behavior
MemberLoads get added without errors.

Screenshots
Possible bug:
https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/184a5d3fd4bd2c0a2053798b4adff328d612822a/RSTAB/Loads/memberLoad.py#L51-L52

Desktop (please complete the following information):

  • Version of WIN10 OS: Microsoft Windows Server 2022 Datacenter
  • Version of RSTAB9: 9.02.0067
  • Version of tool: 1.7.0

Additional context
Possibly this issue occurs also in RFEM SDK

REQUEST: a way to set `members_number_of_divisions_for_result_diagram`

Is your feature request related to a problem? Please describe.
In RFEM it is possible to set members_number_of_divisions_for_result_diagram. Example usage:

from RFEM.initModel import Model, Calculate_all
from RFEM.Results.resultTables import ResultTables
from RFEM.Calculate.meshSettings import MeshSettings

Model(False, "simpleBeam")

# switch to detailde results
Model.clientModel.service.use_detailed_member_results(True)

# set the member division to 12
meshConfig = {'members_number_of_divisions_for_result_diagram': 12}
MeshSettings(meshConfig)

Calculate_all()
resultTable = ResultTables.MembersInternalForces() 

In RSTAB module RSTAB.meshSettings is missing. Probably reasons is that it relies on WS methods:

model.clientModel.service.get_mesh_settings()
model.clientModel.service.set_mesh_settings()

which are missing for RSTAB

raise MethodNotFound(qn)
suds.MethodNotFound: Method not found: 'RstabModel.RstabModelPort.get_mesh_settings'    

Describe the solution you'd like
API way to set members_number_of_divisions_for_result_diagram

Describe alternatives you've considered
_

Additional context
_

BUG: GetDesignOverview() won't work

Describe the bug
GetDesignOverview() reports b"Server raised fault: 'Calculate all first.'" despite Calculate_all()

To Reproduce
Run script:

from RSTAB.enums import NodalSupportType
from RSTAB.initModel import Model, Calculate_all
from RSTAB.BasicObjects.node import Node
from RSTAB.BasicObjects.material import Material
from RSTAB.BasicObjects.section import Section
from RSTAB.BasicObjects.member import Member
from RSTAB.TypesForNodes.nodalSupport import NodalSupport
from RSTAB.Results.designOverview import GetDesignOverview

# create the model
Model(True,'Demo')

# create a basic geometry
Node(1, 0,0,0)
Node(2, 5,0,0)
Material()
Section()
Member(1,1,2,0,1,1)
NodalSupport(1, '1', NodalSupportType.FIXED)

# to be able to get design overview, calculation should be done
Calculate_all()

# get design overview
print(GetDesignOverview())

Expected behavior
return design overview

Screenshots

PS E:\examples\desing_overview> python .\example.py
Connecting to server...
Traceback (most recent call last):
  File "E:\examples\desing_overview\example.py", line 25, in <module>
    print(GetDesignOverview())
          ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\RSTAB\Results\designOverview.py", line 8, in GetDesignOverview
    return model.clientModel.service.get_design_overview()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 559, in __call__
    return client.invoke(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 618, in invoke
    result = self.send(soapenv)
             ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 658, in send
    result = self.succeeded(binding, reply.message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 696, in succeeded
    reply, result = binding.get_reply(self.method, reply)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\bindings\binding.py", line 152, in get_reply
    self.detect_fault(soapbody)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\bindings\binding.py", line 183, in detect_fault
    raise WebFault(p, fault)

Desktop (please complete the following information):

  • Version of WIN10 OS: [WIN 10]
  • Version of RSTAB9: 9.02.0067 | 9.02.0069
  • Version of tool [1.7]

Additional context

REQUEST: args `delete` and `delete_all` for not connected but opened model

Is your feature request related to a problem? Please describe.
delete and delete_all for not connected but opened model do not work right now.:

Model(True, model_name, delete=True, delete_all=True)

As result server raises errors for incoming requests when object IDs already exists.

Describe the solution you'd like
At initModel.py:
https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/main/RSTAB/initModel.py#L117

add code block:

                ### START:: New code block   ###
                if model_name in modelLst:
                    if delete:
                        print('Deleting results...')
                        cModel.service.delete_all_results()
                    if delete_all:
                        print('Delete all...')
                        cModel.service.delete_all()
                ### END:: New code block   ###

Is now:

        else:
            # Requested model which was already connected
            assert model_name in self.clientModelDct or model_name in modelLst, 'WARNING: '+model_name +' is not connected neither opened in RFEM.'

            if model_name in self.clientModelDct:
                cModel = self.clientModelDct[model_name]
            elif model_name in modelLst:
                id = 0
                for i,j in enumerate(modelLst):
                    if modelLst[i] == model_name:
                        id = i
                modelPath =  client.service.get_model(id)
                modelPort = modelPath[-5:-1]
                modelUrlPort = url+':'+modelPort
                modelCompletePath = modelUrlPort+'/wsdl'

                session = requests.Session()
                adapter = requests.adapters.HTTPAdapter(pool_connections=1, pool_maxsize=1)
                session.mount('http://', adapter)
                trans = RequestsTransport(session)

                cModel = Client(modelCompletePath, transport=trans, location = modelUrlPort, cache=ca)

                self.clientModelDct[model_name] = cModel

Would like to have:

            else:
                modelPath = ''
                # Requested new model, model with given name was NOT connected yet but file with the same name was opened
                if model_name in modelLst:
                    id = 0
                    for i,j in enumerate(modelLst):
                        if modelLst[i] == model_name:
                            id = i
                    modelPath =  client.service.get_model(id)
                else:
                    modelPath =  client.service.new_model(original_model_name)
                modelPort = modelPath[-5:-1]
                modelUrlPort = url+':'+modelPort
                modelCompletePath = modelUrlPort+'/wsdl'

                session = requests.Session()
                adapter = requests.adapters.HTTPAdapter(pool_connections=1, pool_maxsize=1)
                session.mount('http://', adapter)
                trans = RequestsTransport(session)

                cModel = Client(modelCompletePath, transport=trans, location = modelUrlPort, cache=ca)
                
                ### START:: New code block   ###
                if model_name in modelLst:
                    if delete:
                        print('Deleting results...')
                        cModel.service.delete_all_results()
                    if delete_all:
                        print('Delete all...')
                        cModel.service.delete_all()
                ### END:: New code block   ###

                self.clientModelDct[model_name] = cModel

Describe alternatives you've considered
It won't work in provided context:

Model(True, model_name, delete=True, delete_all=True)

then I am forced to use:

Model(True, model_name)
cModel = Model.clientModelDct[model_name]
cModel.service.delete_all_results()
cModel.service.delete_all()

Additional context
Right now we use model with same name for better performance. Model is not connected but oppened between requests.
Some time we need to restart solution. We would like to use native options.

BUG: ModelCheck class is not compatible with RSTAB

Describe the bug
RSTAB package offers class ModelCheck() which currently cannot be use with RSTAB as it depends on 'RstabModel.RstabModelPort.model_check__get_object_groups_operation` which seems to be missing.

To Reproduce

   identical_nodes_object_groups = ModelCheck.GetIdenticalNodes(0.0005)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\RSTAB\Tools\ModelCheck.py", line 16, in GetIdenticalNodes
    object_groups = model.clientModel.service.model_check__get_object_groups_operation(operation, tolerance)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 316, in __getattr__        
    return getattr(port, name)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 420, in __getattr__        
    return getattr(m, name)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 511, in __getattr__        
    return self[name]
           ~~~~^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 524, in __getitem__        
    raise MethodNotFound(qn)
suds.MethodNotFound: Method not found: 'RstabModel.RstabModelPort.model_check__get_object_groups_operation'

Expected behavior
...

Screenshots
...
Desktop (please complete the following information):

  • Version of WIN10 OS: [WIN 10 20H2]
  • Version of RSTAB9.04.06
  • Version of tool [e.g. 1.9.1]

Additional context
Are there plans to include missing method inside RSTAB.exe or class will be removed?
I am wondering shall I implement IdenticalNodes detection on my side?

BUG: TypeError: unsupported operand type(s) for +: 'EnumMeta' and 'str' for MemberLoad

Describe the bug
When defining a MemberLoad setting a load_direction parameter via MemberLoadDirection enum a TypeError gets raised.

To Reproduce
Define a MemberLoad with a MemberLoadDirection enum for load_direction parameter, e.g.:

MemberLoad(n+1, 2, str(k+3), MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 3500)

and try to recalculate it so the deleteEmptyAttributes function gets called.

Expected behavior
You can define a MemberLoadDirection enum as load_direction parameter.

Screenshots
Possible bug:
https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/e90adcbd3f97b18d6a3b29b2f8b3c1e66152dfb5/RSTAB/initModel.py#L239-L254

Desktop (please complete the following information):

  • Version of WIN10 OS: Microsoft Windows Server 2022 Datacenter
  • Version of RSTAB9: 9.02.0067
  • Version of tool: 1.7.0

Additional context
Possible solution:

    for i in it:
        if isinstance(i, str) or isinstance(i, int) or isinstance(i, float) or isinstance(i, bool) or isinstance(i, Enum):
            continue
        if len(i) > 2:
            i = deleteEmptyAttributes(i)
        elif i[1] is None or i[1] == "":
            delattr(obj, i[0])
        elif isinstance(i[1], str) or isinstance(i[1], int) or isinstance(i[1], float) or isinstance(i[1], bool) or isinstance(i[1], Enum):
            pass
        else:
            if isinstance(i, tuple):
                i = list(i)
                i[1] = deleteEmptyAttributes(i[1])
                i = tuple(i)
            else:
                i[1] = deleteEmptyAttributes(i[1])

Testing script:
RSTAB_error_eg.py.zip

REQUEST:

Is RSTAB 8.29.0.1 compatible with API ?

BUG: CoordinateSystemType, CoordinateSystemRotationAnglesSequence are missing

Describe the bug
Commit
3cc6805

implements class CoordinateSystem():

bellows dependencies are not included in RSATB 1.9.2:

https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/3cc680550d19d5ed5f51deacb583717f12fc3ba0/RSTAB/BasicObjects/coordinateSystem.py#L2

To Reproduce
Steps to reproduce the behavior:
Just search dependency in main branch
https://github.com/search?q=repo%3ADlubal-Software%2FRSTAB_Python_Client%20CoordinateSystemType&type=code

BUG: Creating new model creates new suds client (each time)

Describe the bug
Whenever one tries to create a new model after closing a new one (model = Model(True, "model_name")), following Exception gets thrown:

    model = Model(True, MODEL_NAME)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\RSTAB\initModel.py", line 126, in __init__
    cModel = Client(modelCompletePath, transport=trans, location = modelUrlPort)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\client.py", line 109, in __init__
    self.set_options(**kwargs)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\client.py", line 129, in set_options
    p.update(kwargs)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 258, in update
    self.set(n, v)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 283, in set
    self.provider(name).__set(name, value)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 428, in __set
    d.linker.updated(self, prev, value)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\options.py", line 40, in updated
    properties.link(tp)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 319, in link
    Link(self, other)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 59, in __init__
    self.validate(a, b)
  File "C:\Users\Administrator\Desktop\RSTAB_Creoox_Test\venv\lib\site-packages\suds\properties.py", line 80, in validate
    raise Exception('Duplicate domain "%s" found' % d)
Exception: Duplicate domain "suds.options" found

It is because whenever a new Model instance is requested, it also creates a new suds Client for the same name and url, here:

https://github.com/Dlubal-Software/RSTAB_Python_Client/blob/14b06d28bc77731d72fe84cdaf6e71cad82161cc/RSTAB/initModel.py#L123-L127

And if there is no other workaround but to entirely close (clean) python runtime and start from the begging...

To Reproduce
Steps to reproduce the behavior:

  1. Create Model instance (model = Model(True, "model_name")).
  2. Add some materials, sections, nodes, loads, etc...
  3. Run calculations
  4. Close model
  5. Create new Model instance (model = Model(True, "new_model_name")) in the same python runtime

At this point you should see the exact same error.

Expected behavior
Creating a new model while maintaining connection to RSTAB/RFEM server.

Desktop (please complete the following information):

  • Version of WIN10 OS: Microsoft Windows Server 2022 Datacenter
  • Version of RSTAB9: 9.02.0057
  • Version of tool: 1.5.0

Additional context
Trying to compare calculations using the same model vs. creating a new model each time. If there is such a need I can provide my testing script.

BUG: demo mode just up to 12 members

Describe the bug
When using the command Calculate_all() I get the error message that in demo mode just up to 12 members can be calculated.

To Reproduce
I have a mid-size model (around 100 members). When I use the command Calculate_all() I get the discribed error message. When I calculate everything explicitly with CalculateSelectedCases() everything is fine.

Expected behavior
I expect that all load cases, load combinations, adons etc. will be calculated.

  • Version of WIN11 Pro
  • Version of RSTAB9.03.0007
  • Version of tool v1.08.0

Additional context
Add any other context about the problem here.

BUG: ResultTables.MembersInternalForcesBySection won't work with RSTAB 9.02.0069

Describe the bug
ResultTables.MembersInternalForcesBySection won't work with RSTAB 9.02.0069.
It works with 9.02.0067

To Reproduce
Run script:

import json
from pathlib import Path

from RSTAB.enums import NodalSupportType
from RSTAB.initModel import Model, Calculate_all
from RSTAB.BasicObjects.node import Node
from RSTAB.BasicObjects.material import Material
from RSTAB.BasicObjects.section import Section
from RSTAB.BasicObjects.member import Member
from RSTAB.enums import (
    ActionCategoryType,
    AnalysisType,
    CaseObjectType,
    DesignSituationType,
    NodalLoadDirection,
)

from RSTAB.LoadCasesAndCombinations.designSituation import DesignSituation
from RSTAB.LoadCasesAndCombinations.loadCase import LoadCase
from RSTAB.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations
from RSTAB.LoadCasesAndCombinations.loadCombination import LoadCombination
from RSTAB.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
from RSTAB.Loads.nodalLoad import NodalLoad
from RSTAB.TypesForNodes.nodalSupport import NodalSupport
# from RSTAB.Results.designOverview import GetDesignOverview
from RSTAB.Results.resultTables import ResultTables


# create the model
Model(True, 'Demo', delete_all=True)

# create a basic geometry
Node(1, 0, 0, 0)
Node(2, 5, 0, 0)
Material(1, "S235", params=None)
Section(1, "IPE 100 | EN 10365:2017 | ArcelorMittal (2018)", params=None)
Member(1, 1, 2, 0, 1 , 1)
NodalSupport(1, '1', NodalSupportType.FIXED)



########################        LoadCases and Combination       ################# noqa #
StaticAnalysisSettings.GeometricallyLinear(1, "Linear")

########################           Design Situations            ################# noqa #
DesignSituation(2, DesignSituationType.DESIGN_SITUATION_TYPE_STR_PERMANENT_AND_TRANSIENT_6_10, True, "Stress")

########################               Load Cases               ################# noqa #
LoadCase(1, "Self Weight", [True, 0.0, 0.0, 1.0], params={"action_category": ActionCategoryType.ACTION_CATEGORY_PERMANENT_G.name})
LoadCase(2, "FinishMaterials", [False], params={"action_category": ActionCategoryType.ACTION_CATEGORY_PERMANENT_G.name})

########################            Load Combination            ################# noqa #
LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 2, combination_items=[[1.35, 1, 0, False], [1.35, 2, 0, False]])

########################              Nodal Loads               ################# noqa #
NodalLoad.Force(1, 2, "2", NodalLoadDirection.LOAD_DIRECTION_LOCAL_Z, 2000.0)

# SetAddonStatus(Model.clientModel, AddOn.steel_design_active, True)

# calculation
Calculate_all()

BASE_DIR = Path(__file__).resolve().parent

# Load Cases
result_file = BASE_DIR / "resultTablesLC.json"
result = {}
result["nd"] = ResultTables.NodesDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["nsf"] = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["mgd"] = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["mif"] = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["mifbs"] = ResultTables.MembersInternalForcesBySection(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["mld"] = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
result["ms"] = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)

with result_file.open(mode="w") as rf:
    rf.write(json.dumps(result, indent=2))


# Load Combinations
result_file = BASE_DIR / "resultTablesCO.json"
result = {}
result["nd"] = ResultTables.NodesDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["nsf"] = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["mgd"] = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["mif"] = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["mifbs"] = ResultTables.MembersInternalForcesBySection(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["mld"] = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)
result["ms"] = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_LOAD_COMBINATION, 1, 1)

with result_file.open(mode="w") as rf:
    rf.write(json.dumps(result, indent=2))

# Design Situation
result_file = BASE_DIR / "resultTablesDS.json"
result = {}
result["nd"] = ResultTables.NodesDeformations(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["nsf"] = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["mgd"] = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["mif"] = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["mifbs"] = ResultTables.MembersInternalForcesBySection(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["mld"] = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)
result["ms"] = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 2, 1)

with result_file.open(mode="w") as rf:
    rf.write(json.dumps(result, indent=2))

Expected behavior
ResultTables.MembersInternalForcesBySection should work as in RSTAB 9.02.0067

Screenshots

PS E:\debug\rstab_0069_breaks_result_tables> python example.py
Connecting to server...
Traceback (most recent call last):
  File "E:\debug\rstab_0069_breaks_result_tables\example.py", line 72, in <module>
    result["mifbs"] = ResultTables.MembersInternalForcesBySection(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, 2, 1)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\RSTAB\Results\resultTables.py", line 605, in MembersInternalForcesBySection
    return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces_by_section(loading_type.name, loading_no, object_no), include_base)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 559, in __call__
    return client.invoke(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 618, in invoke
    result = self.send(soapenv)
             ^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 658, in send
    result = self.succeeded(binding, reply.message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 696, in succeeded
    reply, result = binding.get_reply(self.method, reply)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\bindings\binding.py", line 166, in get_reply
    result = unmarshaller.process(nodes[0], resolved)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\typed.py", line 66, in process
    return Core.process(self, content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 52, in process
    return self.append(content)
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 67, in append
    self.append_children(content)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 148, in append_children
    cval = self.append(cont)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 67, in append
    self.append_children(content)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 148, in append_children
    cval = self.append(cont)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 67, in append
    self.append_children(content)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 148, in append_children
    cval = self.append(cont)
           ^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\core.py", line 68, in append
    self.append_text(content)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\typed.py", line 135, in append_text
    content.text = self.translated(content.text, known)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\umx\typed.py", line 141, in translated
    return resolved.translate(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\xsd\sxbuiltin.py", line 97, in translate
    return int(value)
           ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'IPE 100 | 1 - S235

Desktop (please complete the following information):

  • Version of WIN10 OS: [WIN 10 ]
  • Version of RSTAB9.02.0069
  • Version of tool [e.g. RSTAB==1.7]

Additional context
not this time

BUG: `CalculateSelectedCases()` raises Attribute Error

Calculating with CalculateSelectedCases() raises Attribute Error.

Steps to reproduce the behavior:

  1. Open the model from the zip below
  2. Run the minimal Python-Example script from the zip

image

Desktop (please complete the following information):

  • Windows 11 Pro for Workstations
  • RSTAB9.04.0004
  • Version of tool 1.8.0
    min_ex.zip

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

Describe the bug
I just updated RSTAB
Running working models on updated RSTAB application I got AttributeError when use ResultTable

To Reproduce
Steps to reproduce the behavior:
use ResultTables.NodesSupportForces

Screenshots

File "C:\Users\creoox_admin\Desktop\creoox-engineering-rstab-worker\examples\debug\result_tables_problem.py\debug_model.py", line 559, in collect_results_from_resultTableAPI
    nodal_support_forces = ResultTables.NodesSupportForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE, load_case_id, node_id)
  File "C:\Users\creoox_admin\Desktop\creoox-engineering-rstab-worker\venv\lib\site-packages\RSTAB\Results\resultTables.py", line 911, in NodesSupportForces
    return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_nodes_support_forces(loading_type.name, loading_no, object_no), include_base)
  File "C:\Users\creoox_admin\Desktop\creoox-engineering-rstab-worker\venv\lib\site-packages\RSTAB\Results\resultTables.py", line 39, in ConvertResultsToListOfDct
    params = GetResultTableParameters(results)
  File "C:\Users\creoox_admin\Desktop\creoox-engineering-rstab-worker\venv\lib\site-packages\RSTAB\Results\resultTables.py", line 22, in GetResultTableParameters
    params['row'] = list(set(params['row'] + i.row.__keylist__))
AttributeError: 'Text' object has no attribute '__keylist__'

Desktop (please complete the following information):

  • Version of WIN10 OS: [WIN 10 20H2]
  • Version of RSTAB 9.03.0005
  • Version of tool RSTAB==1.7.0

BUG: Race condition when use PrintoutReport?

Describe the bug

PS E:\debug\printout_report> python .\example.py
Connecting to server...
Traceback (most recent call last):
  File "E:\debug\printout_report\example.py", line 17, in <module>
    PrintoutReport.exportToPDF(2, PDF_REPORTS_DIR / f"2.pdf")
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\RSTAB\Reports\printoutReport.py", line 29, in exportToPDF
    model.clientModel.service.export_printout_report_to_pdf(report_id, target_file_path)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 559, in __call__
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 658, in send
    result = self.succeeded(binding, reply.message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\client.py", line 696, in succeeded
    reply, result = binding.get_reply(self.method, reply)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\bindings\binding.py", line 152, in get_reply
    self.detect_fault(soapbody)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\suds\bindings\binding.py", line 183, in detect_fault      
    raise WebFault(p, fault)
suds.WebFault: b"Server raised fault: 'Failed to export a report with the following error: Cannot export data to the printout report 'C:/Users/Administrator/AppData/Local/Dlubal/RSTAB9_9.02/instanceV2_7040_133324233331675213/cxemodel_rs9_0/content/reports/Demo2_2.rpr', because export process is already in progress.'"

To Reproduce
Happens randomly when want to export multiple reports. Assuming connected model has defined printout reports with id 1, 2, then sometimes it is possible to meet error with script

from pathlib import Path
from RSTAB.initModel import Model
from RSTAB.Reports.printoutReport import PrintoutReport

BASE_DIR = Path(__file__).resolve().parent
PRINTOUT_REPORTS_DEDICATED_DIR = BASE_DIR / "printout_reports"
PDF_REPORTS_DIR = PRINTOUT_REPORTS_DEDICATED_DIR / "pdf"
PDF_REPORTS_DIR.mkdir(parents=True, exist_ok=True)
HTML_REPORTS_DIR = PRINTOUT_REPORTS_DEDICATED_DIR / "html"
HTML_REPORTS_DIR.mkdir(parents=True, exist_ok=True)

Model(False,'cxe-model')

# loop is intentional to create error
for i in range(6):
    PrintoutReport.exportToPDF(1, PDF_REPORTS_DIR / f"1.pdf")
    PrintoutReport.exportToPDF(2, PDF_REPORTS_DIR / f"2.pdf")
    
    PrintoutReport.exportToHTML(1, HTML_REPORTS_DIR / f"1.html")
    PrintoutReport.exportToHTML(2, HTML_REPORTS_DIR / f"2.html")

Expected behavior
_
Screenshots
_

Desktop (please complete the following information):

  • Version of WIN10 OS: [WIN 10 ]
  • Version of RSTAB9
  • Version of tool [e.g. 1.7]

Additional context
_

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.