├── .gitconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ └── python-publish.yml ├── .gitignore ├── .gitmessage ├── .nojekyll ├── .vscode ├── launch.json └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Examples ├── BasicExample │ ├── main.py │ └── window.py ├── CalculateInCloudExample │ └── CalculateInCloudExample.py ├── Cantilever │ └── Demo1.py ├── CantileverQt │ ├── Main.py │ ├── Main.ui │ └── rc │ │ └── 001.png ├── ConcreteBridge │ ├── README.md │ ├── concrete_bridge.py │ └── demo_image.png ├── DynamicAnalysis │ └── DynamicAnalysis.py ├── GPT_Tank │ ├── ChatGPT_Tank_D.ipynb │ ├── ChatGPT_Tank_E.ipynb │ ├── RFEM_bot.py │ ├── RFEM_prompts.py │ └── templates │ │ ├── crosssection.txt │ │ ├── geometry.txt │ │ ├── introduction.txt │ │ ├── load.txt │ │ ├── material.txt │ │ ├── results.txt │ │ └── solver.txt ├── GetRFEMData │ ├── ExcelGlobalParamTest.xlsx │ ├── GetOptimizedValues.py │ └── GlobalParametersAndFormulas.py ├── Hall │ └── hall.py ├── LinkUSGS │ ├── README.md │ ├── UsgsRFEMLink.py │ ├── access.py │ └── assets │ │ └── logo_round.png ├── RSectionExample │ ├── Demo_import_from_rsection.py │ └── thin_walled.rsc ├── ScriptGenerator │ ├── README.md │ ├── WSScripGenerator.py │ └── XMLScripGenerator.py ├── SteelDesign │ ├── README.md │ ├── SteelDesignExcel.py │ ├── SteelDesignExcel.xlsm │ ├── SteelHall.py │ └── img │ │ ├── xlwingsInterpreter.png │ │ └── xlwingsRun.png ├── TankWebApp │ ├── assets │ │ ├── logo.png │ │ └── style.css │ ├── export.vtk │ ├── export │ │ ├── export.mtl │ │ ├── export.obj │ │ └── export_0.vtp │ ├── responsiveTank.py │ └── tankWebApp.py ├── Timber_Design │ └── timber_hall.py ├── TrussGenerator_2D │ ├── TrussGenerator.py │ └── sources │ │ ├── diag_1.png │ │ ├── diag_2.png │ │ ├── diag_3.png │ │ ├── diag_4.png │ │ ├── diag_5.png │ │ ├── diag_6.png │ │ ├── diag_7.png │ │ ├── logo_round.png │ │ ├── truss_1.png │ │ ├── truss_2.png │ │ ├── truss_3.png │ │ ├── truss_4.png │ │ └── truss_5.png └── __init__.py ├── LICENSE ├── MANIFEST.in ├── PythonWSClient.code-workspace ├── README.md ├── REVIEW_BEST_PRACTICES.md ├── RFEM ├── AluminumDesign │ ├── __init__.py │ ├── aluminumSLSConfiguration.py │ └── aluminumULSConfiguration.py ├── BasicObjects │ ├── __init__.py │ ├── bracing.py │ ├── frame.py │ ├── line.py │ ├── lineSet.py │ ├── material.py │ ├── member.py │ ├── memberSet.py │ ├── node.py │ ├── opening.py │ ├── section.py │ ├── solid.py │ ├── solidSet.py │ ├── surface.py │ ├── surfaceSet.py │ └── thickness.py ├── Calculate │ ├── __init__.py │ ├── meshSettings.py │ └── optimizationSettings.py ├── ConcreteDesign │ ├── ConcreteServiceabilityConfigurations.py │ ├── ConcreteUltimateConfigurations.py │ └── __init__.py ├── DynamicLoads │ ├── __init__.py │ └── responseSpectrum.py ├── GuideObjects │ ├── __init__.py │ ├── coordinateSystem.py │ └── note.py ├── Imperfections │ ├── __init__.py │ ├── imperfectionCase.py │ ├── memberImperfection.py │ └── membersetImperfection.py ├── ImportExport │ ├── __init__.py │ ├── exports.py │ └── imports.py ├── LoadCasesAndCombinations │ ├── __init__.py │ ├── action.py │ ├── actionCombination.py │ ├── combinationWizard.py │ ├── designSituation.py │ ├── loadCase.py │ ├── loadCasesAndCombinations.py │ ├── loadCombination.py │ ├── modalAnalysisSettings.py │ ├── resultCombination.py │ ├── spectralAnalysisSettings.py │ ├── stabilityAnalysisSettings.py │ ├── staticAnalysisSettings.py │ └── windSimulationAnalysisSetting.py ├── Loads │ ├── __init__.py │ ├── freeLoad.py │ ├── imposedLineDeformation.py │ ├── imposedNodalDeformation.py │ ├── lineLoad.py │ ├── linesetLoad.py │ ├── memberLoad.py │ ├── membersetload.py │ ├── nodalLoad.py │ ├── openingLoad.py │ ├── solidLoad.py │ ├── solidSetLoad.py │ ├── surfaceLoad.py │ └── surfacesetload.py ├── Reports │ ├── __init__.py │ ├── favicon32.png │ ├── html.py │ ├── htmlScript.js │ ├── htmlStyles.css │ ├── partsList.py │ └── printoutReport.py ├── Results │ ├── __init__.py │ ├── designOverview.py │ ├── meshTables.py │ └── resultTables.py ├── SpecialObjects │ ├── __init__.py │ ├── borehole.py │ ├── enlargedColumnHead.py │ ├── intersection.py │ ├── lineRelease.py │ ├── nodalRelease.py │ ├── resultSection.py │ ├── rigidLink.py │ ├── structureModification.py │ ├── surfaceContact.py │ ├── surfaceRelease.py │ └── surfaceResultsAdjustment.py ├── SteelDesign │ ├── __init__.py │ ├── steelServiceabilityConfiguration.py │ └── steelUltimateConfigurations.py ├── TimberDesign │ ├── __init__.py │ ├── timberFireConfiguration.py │ ├── timberServiceLimitStateConfigurations.py │ └── timberUltimateConfigurations.py ├── Tools │ ├── GetObjectNumbersByType.py │ ├── ModelCheck.py │ ├── PlausibilityCheck.py │ ├── __init__.py │ ├── centreOfGravityAndObjectInfo.py │ └── sectionDialogue.py ├── TypesForAluminumDesign │ ├── __init__.py │ ├── aluminumEffectiveLengths.py │ ├── aluminumMemberLocalSectionReduction.py │ └── aluminumMemberTransverseWelds.py ├── TypesForLines │ ├── __init__.py │ ├── lineHinge.py │ ├── lineMeshRefinements.py │ ├── lineSupport.py │ └── lineWeldedJoint.py ├── TypesForMembers │ ├── __init__.py │ ├── designSupport.py │ ├── memberDefinableStiffness.py │ ├── memberEccentricity.py │ ├── memberHinge.py │ ├── memberNonlinearity.py │ ├── memberResultIntermediatePoints.py │ ├── memberRotationalRestraint.py │ ├── memberShearPanel.py │ ├── memberSpring.py │ ├── memberStiffnessModification.py │ ├── memberSupport.py │ └── memberTransverseStiffeners.py ├── TypesForNodes │ ├── __init__.py │ ├── nodalMeshRefinement.py │ └── nodalSupport.py ├── TypesForSolids │ ├── __init__.py │ ├── solidContact.py │ ├── solidGas.py │ └── solidMeshRefinement.py ├── TypesForSpecialObjects │ ├── __init__.py │ ├── lineReleaseType.py │ ├── nodalReleaseType.py │ ├── surfaceContactType.py │ └── surfaceReleaseType.py ├── TypesForSteelDesign │ ├── SteelMemberLocalSectionReduction.py │ ├── __init__.py │ ├── steelBoundaryConditions.py │ └── steelEffectiveLengths.py ├── TypesForSurfaces │ ├── __init__.py │ ├── surfaceEccentricity.py │ ├── surfaceMeshRefinements.py │ ├── surfaceStiffnessModification.py │ └── surfaceSupport.py ├── TypesForTimberDesign │ ├── __init__.py │ ├── timberEffectiveLengths.py │ ├── timberMemberLocalSectionReduction.py │ ├── timberMoistureClass.py │ ├── timberServiceClass.py │ └── timberServiceCondition.py ├── TypesforConcreteDesign │ ├── ConcreteDurability.py │ ├── ConcreteEffectiveLength.py │ ├── ConcreteReinforcementDirections.py │ ├── ConcreteSurfaceReinforcements.py │ └── __init__.py ├── __init__.py ├── baseData.py ├── baseSettings.py ├── connectionGlobals.py ├── dataTypes.py ├── dependencies.py ├── enums.py ├── formula.py ├── globalParameter.py ├── initModel.py └── suds_requests.py ├── UnitTests ├── Examples.py ├── README.md ├── conftest.py ├── report.html ├── src │ ├── import_test_saf.saf │ ├── import_test_xlsx.xlsx │ ├── import_test_xml.xml │ ├── printout.rf6 │ ├── rsection_test.rsc │ ├── timberMoistureClass.rf6 │ ├── timberServiceConditionCSA.rf6 │ ├── timberServiceConditionGB.rf6 │ └── timberServiceConditionNDS.rf6 ├── template.py ├── test_Action.py ├── test_ActionCombination.py ├── test_AddOns.py ├── test_BaseSettings_test.py ├── test_DesignOverview.py ├── test_DesignSituations.py ├── test_Export.py ├── test_Free_Load_Test.py ├── test_GetAllObjects.py ├── test_GetObjectNumbersByType.py ├── test_GlobalParameters_Test.py ├── test_LineLoads_Test.py ├── test_LineRelease.py ├── test_LineReleaseType.py ├── test_LineSupports.py ├── test_LoadCases_Test.py ├── test_LoadDistributionSurface_Test.py ├── test_MemberLoad_test.py ├── test_MemberSetLoad_test.py ├── test_Member_test.py ├── test_MembraneSurface_Test.py ├── test_MembraneWithoutTensionSurface_Test.py ├── test_MeshGenerationStatistics.py ├── test_MeshTables.py ├── test_ModelCheck.py ├── test_NodalLoad_test.py ├── test_Reports.py ├── test_ResponseSpectrum.py ├── test_ResultCombination.py ├── test_ResultTables.py ├── test_RigidLinks.py ├── test_RigidSurface_Test.py ├── test_SectionDialogue.py ├── test_SolidLoads.py ├── test_SolidSetLoads.py ├── test_SpecialObjects.py ├── test_SpectralSettings_test.py ├── test_StandardSurface_Test.py ├── test_SteelMemberLocalSectionReduction.py ├── test_SurfaceLoad_test.py ├── test_SurfaceRelease.py ├── test_SurfaceReleaseType.py ├── test_SurfaceSetLoad_test.py ├── test_Thickness_Test.py ├── test_TypesForNodes.py ├── test_TypesForSolids.py ├── test_TypesForSurfaces.py ├── test_WithoutThicknessSurface_Test.py ├── test_aluminumDesignSLSConfiguration.py ├── test_aluminumDesignULSConfigurations.py ├── test_aluminumEffectiveLengths.py ├── test_aluminumMemberLocalSectionReduction.py ├── test_aluminumMemberTransverseWeld.py ├── test_availableActionCategories.py ├── test_baseData.py ├── test_basic_objects.py ├── test_borehole.py ├── test_combinationWizard.py ├── test_concreteDesign.py ├── test_concreteDesignConfig.py ├── test_designSupport.py ├── test_formula.py ├── test_guide_objects.py ├── test_imperfectionCase.py ├── test_initModel.py ├── test_intersections.py ├── test_loadCasesAndCombinations.py ├── test_loadCombination.py ├── test_loads.py ├── test_member.py ├── test_memberDefinableStiffness.py ├── test_memberRotationalRestraint.py ├── test_memberShearPanel.py ├── test_memberSpring.py ├── test_memberSupport.py ├── test_member_set.py ├── test_modalAnalysis_test.py ├── test_modelInfo.py ├── test_multipleModels.py ├── test_nodalRelease.py ├── test_nodalReleaseType.py ├── test_node.py ├── test_note.py ├── test_objectInformation.py ├── test_plausiblityCheck.py ├── test_resultTableAddOn.py ├── test_saveFile.py ├── test_solids.py ├── test_stabilitysettings.py ├── test_staticAnalysisSetting.py ├── test_steelBoundaryConditions.py ├── test_steelDesignServiceabilityConfiguration.py ├── test_steelDesignUltimateConfigurations.py ├── test_steelEffectiveLengths.py ├── test_suds_requests.py ├── test_timberDesignFireConfigurations.py ├── test_timberDesignServiceLimitStateConfigurations.py ├── test_timberDesignUltimateConfigurations.py ├── test_timberEffectiveLengths.py ├── test_timberMemberLocalSectionReduction.py ├── test_timberMoistureClass.py ├── test_timberServiceClass.py ├── test_timberServiceConditionCSA.py ├── test_timberServiceConditionGB.py ├── test_timberServiceConditionNDS.py ├── test_typesForLines.py ├── test_typesForMembers.py ├── test_windSimulationAnalysisSetting.py ├── test_zCalculate.py └── tools.py ├── assets └── style.css ├── img ├── 2Dtruss.gif ├── PyPI.png ├── Python.png ├── RFEM.gif ├── RFEM.png ├── RSTAB.png ├── csharp.png ├── github-dark.svg ├── github-light.svg ├── globe-dark.svg ├── globe-light.svg ├── instagram-dark.svg ├── instagram-light.svg ├── linkedin-dark.svg ├── linkedin-light.svg ├── logo.gif ├── logo.png ├── terminal-dark.svg ├── terminal-light.svg ├── twitter-dark.svg ├── twitter-light.svg ├── youtube-dark.svg └── youtube-light.svg ├── pull_request_template.md ├── pylintrc └── setup.py /.gitconfig: -------------------------------------------------------------------------------- 1 | [commit] 2 | template = ~/.gitmessage -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | @OndraMichal 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: 'BUG: ' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - Version of WIN10 OS: [WIN 10 20H2] 28 | - Version of RFEM6 29 | - Version of tool [e.g. 1.0.1] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: 'REQUEST:' 5 | labels: enhancement, question 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | name: Upload Python Package 2 | 3 | #on: 4 | #release: 5 | #types: [published] 6 | on: 7 | workflow_dispatch: # Trigger the workflow manually 8 | 9 | jobs: 10 | deploy: 11 | 12 | runs-on: ubuntu-24.04 13 | 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Set up Python 17 | uses: actions/setup-python@v5 18 | with: 19 | python-version: '3.x' 20 | - name: Install dependencies 21 | run: | 22 | pip install -U pip 23 | pip install setuptools wheel twine 24 | - name: Build and publish 25 | env: 26 | TWINE_USERNAME: __token__ 27 | TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} 28 | run: | 29 | python setup.py sdist bdist_wheel 30 | twine upload dist/* 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | develop-eggs/ 12 | dist/ 13 | downloads/ 14 | eggs/ 15 | .eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | wheels/ 22 | pip-wheel-metadata/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | .tox/ 41 | .nox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | *.py,cover 49 | .hypothesis/ 50 | .pytest_cache/ 51 | UnitTests/testResults/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | db.sqlite3-journal 62 | 63 | # Flask stuff: 64 | instance/ 65 | .webassets-cache 66 | 67 | # Scrapy stuff: 68 | .scrapy 69 | 70 | # Sphinx documentation 71 | 72 | # PyBuilder 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # IPython 79 | profile_default/ 80 | ipython_config.py 81 | 82 | # pyenv 83 | .python-version 84 | 85 | # pipenv 86 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 87 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 88 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 89 | # install all needed dependencies. 90 | #Pipfile.lock 91 | 92 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 93 | __pypackages__/ 94 | 95 | # Celery stuff 96 | celerybeat-schedule 97 | celerybeat.pid 98 | 99 | # SageMath parsed files 100 | *.sage.py 101 | 102 | # Environments 103 | .env 104 | .venv 105 | env/ 106 | venv/ 107 | ENV/ 108 | env.bak/ 109 | venv.bak/ 110 | 111 | # Spyder project settings 112 | .spyderproject 113 | .spyproject 114 | 115 | # Rope project settings 116 | .ropeproject 117 | 118 | # mkdocs documentation 119 | /site 120 | 121 | # mypy 122 | .mypy_cache/ 123 | .dmypy.json 124 | dmypy.json 125 | 126 | # Pyre type checker 127 | .pyre/ 128 | 129 | # Examples 130 | Examples/TankWebApp/ 131 | Examples/ScriptGenerator/ 132 | -------------------------------------------------------------------------------- /.gitmessage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Unit tests: 5 | Examples: -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/.nojekyll -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Python: Current File", 9 | "type": "python", 10 | "request": "launch", 11 | "program": "${file}", 12 | "console": "integratedTerminal" 13 | }, 14 | { 15 | "name": "Main", 16 | "type": "python", 17 | "request": "launch", 18 | "program": "main.py", 19 | "console": "integratedTerminal" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.trimTrailingWhitespace": true, 3 | "editor.tabSize": 4, 4 | "editor.insertSpaces": true, 5 | "python.linting.pylintEnabled": false, 6 | "python.linting.pylintArgs": [], 7 | "python.linting.enabled": false, 8 | "python.linting.pydocstyleEnabled": false, 9 | "python.testing.unittestEnabled": false, 10 | "python.testing.pytestEnabled": true, 11 | "python.testing.pytestArgs": [ 12 | "--html=UnitTests\\report.html", 13 | "--self-contained-html", 14 | ], 15 | "esbonio.server.enabled": false, 16 | // Controls if quick suggestions should show up while typing 17 | "editor.quickSuggestions": { 18 | "other": true, 19 | "comments": false, 20 | "strings": false 21 | }, 22 | "editor.formatOnSave": false, 23 | "python.analysis.completeFunctionParens": true, 24 | "python.disableInstallationCheck": true, 25 | "python.linting.banditEnabled": true, 26 | "python.languageServer": "Pylance", 27 | "python.analysis.diagnosticSeverityOverrides": { 28 | "reportOptionalMemberAccess": "none", 29 | "reportGeneralTypeIssues": "none", 30 | } 31 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Dear contributors, 4 | 5 | This work started at the end of 2020 with the intention to enable our users to use our products more freely. To enable to program you own solutions to current challanges. To create parametric and custom made scripts to unlock full potential of what we offer as company. 6 | 7 | That said we created this Client to resemble RFEM as close as possible. To enable inexperienced users to get their solutions up and running ASAP. This also means that we follow certain structure. It is maybe not the most Pythonic API you came across, but it follows our intention well. It is important to note, that it doesn’t mean we prohibit individual solutions. Quite the opposite. You can create forks that suit your needs. We can even share solutions and we will be excited if you decide to work with us. But when contributing to our public Client, please follow the idea as close as possible. We spend a lot of time enhancing it and make it the best experince possible. 8 | 9 | We appeciate all your contributions. 10 | 11 | ## Setup 12 | * Sign into your GitHub account, or [create a free GitHub account](https://github.com/join) if you don't have one. 13 | * Read [license](/LICENSE) of the project 14 | * [Fork](https://github.com/Dlubal-Software/RFEM_Python_Client/fork) the project repository 15 | This creates a copy of our project repository in your GitHub account. 16 | Now, you can update your repository from upstream. 17 | * Clone repository to your desktop 18 | 19 | ## Development 20 | * Make your branch with specified naming - yourGitHubName-FeatureName 21 | * Add your development 22 | * **Do not change anything in automatically generated source code files in our docs** 23 | * Follow [Python standards](https://peps.python.org/pep-0008/). Also using Pylint is great idea 24 | * We prefer to use DocStrings directly in the code, so that documentation could be generated 25 | * Create Unit Tests for testing your development 26 | * Create example to present newly created feature 27 | * Check your spelling and grammar 28 | * Execute static analysis of the code using for example Pylint 29 | * Update your forked repository from upstream 30 | * Solve possible conflicts 31 | * Create Pull request 32 | * Your code will be reviewed 33 | * Once Pull request is approved code is merged and branch deleted 34 | * We will add you as contributor 35 | 36 | Please note we have a [code of conduct](/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. 37 | -------------------------------------------------------------------------------- /Examples/CalculateInCloudExample/CalculateInCloudExample.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | baseName = os.path.basename(__file__) 4 | dirName = os.path.dirname(__file__) 5 | print('basename: ', baseName) 6 | print('dirname: ', dirName) 7 | sys.path.append(dirName + r'/../..') 8 | 9 | from RFEM.initModel import Model, CalculateInCloud 10 | from RFEM.initModel import saveFile 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.material import Material 13 | from RFEM.BasicObjects.section import Section 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.enums import NodalSupportType, MemberLoadDirection, ActionCategoryType 17 | from RFEM.Loads.memberLoad import MemberLoad 18 | from RFEM.LoadCasesAndCombinations.loadCase import LoadCase 19 | 20 | Model(new_model=True, model_name='Cloudtest.rf6', delete=False) 21 | 22 | # Create RFEM model 23 | Model.clientModel.service.begin_modification() 24 | Node(1) 25 | Node(2, 5, 0, 0) 26 | 27 | Material(1, "S235") 28 | Section(1,"IPE 300", 1) 29 | 30 | Member(1, 1,2, 0, 1, 1) 31 | NodalSupport(1, "1", NodalSupportType.FIXED) 32 | NodalSupport(2, "2", NodalSupportType.HINGED) 33 | 34 | LoadCase.StaticAnalysis(1, 'Self-Weight',analysis_settings_no=1,self_weight=[True, 0.0, 0.0, 1.0]) 35 | LoadCase.StaticAnalysis(2, 'Variable',analysis_settings_no=1,action_category=ActionCategoryType.ACTION_CATEGORY_IMPOSED_LOADS_CATEGORY_B_OFFICE_AREAS_QI_B) 36 | 37 | MemberLoad(1, 2, "1", MemberLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, 5000) 38 | 39 | Model.clientModel.service.finish_modification() 40 | 41 | saveFile(dirName + "\Cloudtest.rf6") 42 | 43 | # Define on which server the cloud calculation should be run 44 | server_name = "Dlu_1" 45 | 46 | # No plausibility check should be done before cloud calculation is started 47 | run_plausibility_check = False 48 | 49 | # When False cloud calculation is not started when there are errors in plausibility check 50 | calculate_despite_warnings_and_errors = False 51 | 52 | # When true, email notifications for start and end of cloud calculation are sent 53 | email_notification = True 54 | 55 | result = CalculateInCloud(server_name, run_plausibility_check, calculate_despite_warnings_and_errors, email_notification) 56 | 57 | # First list object = task ID of cloud calculation task 58 | # Second list object = status of calculation 59 | if result: 60 | task_id = result[0] 61 | status = result[1] 62 | print(f"Task-ID: {task_id}") 63 | print(f"Status: {status}") -------------------------------------------------------------------------------- /Examples/CantileverQt/rc/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/CantileverQt/rc/001.png -------------------------------------------------------------------------------- /Examples/ConcreteBridge/README.md: -------------------------------------------------------------------------------- 1 | # Script for generating basic concrete bridge 2 | script generates simple bridge structure based on provided parameters 3 | 4 | there are two groups of parameters: 5 | 6 | -primary parameters - general dimensions of the structure, load magnitude 7 | 8 | -secondary parameters - that are by default derived from the primary parameters, but can be adjusted manually 9 | 10 | One loadcase is generated as a "live load" that can be adjusted to act on whole bridge or on alternating bridge fields. 11 | 12 | There is no GUI or terminal input provided, parameters are meant to be changed in the script itself and then run. 13 | 14 | ![image](demo_image.png) 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Examples/ConcreteBridge/demo_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/ConcreteBridge/demo_image.png -------------------------------------------------------------------------------- /Examples/GPT_Tank/RFEM_bot.py: -------------------------------------------------------------------------------- 1 | from RFEM_prompts import * 2 | import openai 3 | import os 4 | 5 | openai.api_key = os.getenv('OPENAI_API_KEY') 6 | 7 | # Initialize conversation 8 | conversaton = [] 9 | 10 | # Example OpenAI Python library request 11 | MODEL = "gpt-4o" 12 | 13 | # Conversation loop 14 | while True: 15 | # Get user message and process prompt 16 | if len(conversaton) == 0: 17 | print('\n') 18 | print(f"\033[{34}m{'I am an AI bot that will help you define your RFEM model. Please give me a general instruction and a description of the model to begin with.'}\033[0m") 19 | general_instruction = input('\n') 20 | processed_instruction = process_prompt(general_instruction) 21 | conversaton.append({"role": "system", "content": processed_instruction}) 22 | print() 23 | print(f"\033[{34}m{'Now you can continue defining the different modules of the RFEM model.'}\033[0m") 24 | user_prompt = input('\n') 25 | processed_prompt = process_prompt(user_prompt) 26 | # Add message to conversation 27 | conversaton.append({"role": "user", "content": processed_prompt}) 28 | # Get ChatGPT answer 29 | response = openai.ChatCompletion.create( 30 | model=MODEL, 31 | messages=conversaton, 32 | temperature=0, 33 | ) 34 | # Print answer 35 | assitant_answer = response['choices'][0]['message']['content'] 36 | print() 37 | print(f"\033[{34}m{assitant_answer}\033[0m") 38 | # Add answer to conversation 39 | conversaton.append({"role": "assistant", "content": assitant_answer}) -------------------------------------------------------------------------------- /Examples/GPT_Tank/RFEM_prompts.py: -------------------------------------------------------------------------------- 1 | # Module for using prompt templates to define RFEM 6 models 2 | 3 | def read_file(file_path): 4 | with open(file_path, "r", encoding="utf-8") as file: 5 | return file.read() 6 | 7 | _INTRODUCTION_TPL = read_file("templates/introduction.txt") 8 | _MATERIAL_TPL = read_file("templates/Material.txt") 9 | _Geometry_TPL = read_file("templates/Geometry.txt") 10 | _CrossSection_TPL = read_file("templates/crosssection.txt") 11 | _LOAD_TPL = read_file("templates/load.txt") 12 | _SOLVER_TPL = read_file("templates/solver.txt") 13 | _RESULTS_TPL = read_file("templates/results.txt") 14 | 15 | _keywords = { 16 | 'INTRO':_INTRODUCTION_TPL, 17 | 'MATERIAL': _MATERIAL_TPL, 18 | 'GEOMETRY':_Geometry_TPL, 19 | 'CROSSSECTION':_CrossSection_TPL, 20 | 'LOADS': _LOAD_TPL, 21 | 'SOLVER': _SOLVER_TPL, 22 | 'RESULTS': _RESULTS_TPL, 23 | } 24 | 25 | 26 | # Process prompt to use template if applicable 27 | # The template keyword shall be specified at the beginning of the prompt with a semicolon 28 | # Example: 29 | # MATERIAL: My model... 30 | 31 | def process_prompt(prompt): 32 | if ':' not in prompt: 33 | return prompt 34 | key, value = prompt.split(':', 1) 35 | if key not in _keywords: 36 | return prompt 37 | return _keywords[key].format(placeholder =value) -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/crosssection.txt: -------------------------------------------------------------------------------- 1 | Let’s start with the Cross Section section. {placeholder} 2 | 3 | This is the syntax: 4 | 5 | Section(no: int = 1, name: str = 'IPE 300', material_no: int = 1, comment: str = '', params: dict = None, model = Model) 6 | 7 | Thickness(no: int = 1, name: str = None, material_no: int = 1, uniform_thickness_d: float = 0.20, comment: str = '', params: dict = None, model = Model) 8 | 9 | Surface.Standard(no: int = 1, geometry_type = SurfaceGeometry.GEOMETRY_PLANE, geometry_type_parameters = None, boundary_lines_no: str = '1 2 3 4', thickness: int = 1, comment: str = '', params: dict = None, model = Model) 10 | 11 | the boundary_lines_no contains the lines defining Surface, e.g. Line or Line.Circle 12 | the boundary lines for defining a Surface have to be a convex hull. 13 | 14 | For the Surface.Standard class, the geometry_type comes in classes: 15 | 1) for flat planes: SurfaceGeometry.GEOMETRY_PLANE: it has no geometry_type_parameters 16 | 17 | 2) for curved surfaces, such as shells or membranes: SurfaceGeometry.GEOMETRY_QUADRANGLE: geometry_type_parameters = [quadrangle_corner_node_1, quadrangle_corner_node_2, quadrangle_corner_node_3, quadrangle_corner_node_4] 18 | 19 | 3) for surfaces of revolution: SurfaceGeometry.GEOMETRY_ROTATED: geometry_type_parameters = [rotated_angle_of_rotation, [rotated_point_p_x, rotated_point_p_y, rotated_point_p_z], [rotated_point_r_x, rotated_point_r_y, rotated_point_r_z], rotated_boundary_line] 20 | 21 | For SurfaceGeometry.GEOMETRY_ROTATED only 1 line can be rotated not multiple and boundary_lines_no is the string of rotated_boundary_line! 22 | 23 | Solid(no: int = 1, boundary_surfaces_no: str = '1 2', material_no: int = 1, comment: str = '', params: dict = None, model = Model) 24 | 25 | 26 | This is an example of the Python code for a Cross Section: 27 | 28 | # ---- Cross Sections Sec ---- 29 | 30 | Thickness(1, '12 mm', 1, 0.012) 31 | 32 | Surface.Standard(1, SurfaceGeometry.GEOMETRY_QUADRANGLE, [1,2,0,0], '1 2 3', 1) # for shapes defined by a quadrangle 33 | Surface.Standard(3, SurfaceGeometry.GEOMETRY_PLANE, [360, [0,0,0], [0,0,1], 4], "2 3", 1) # for flat plane surfaces using lines 2 and 3 34 | Surface.Standard(2, SurfaceGeometry.GEOMETRY_ROTATED, [360, [0,0,0], [0,0,1], 4], "2 3", 1) # for rotated surfaces 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/geometry.txt: -------------------------------------------------------------------------------- 1 | Now let’s move on to the Geometry section. {placeholder} 2 | 3 | This is the syntax of the Geometry section: 4 | 5 | Node(no: int = 1, coordinate_X: float = 0.0, coordinate_Y: float = 0.0, coordinate_Z: float = 0.0, comment: str = '', params: dict = None, model = Model) 6 | 7 | Lines come in different methods: 8 | Line(no: int = 1, nodes_no: str = '1 2', comment: str = '', params: dict = None, model = Model) # simple Line 9 | Line.Arc(no: int, nodes_no: list, control_point: list, comment: str = '', params: dict = None, model = Model) # arch 10 | Line.Circle(no: int = 1, center_of_cirle: list = [20,0,0], circle_radius: float = 1.0, point_of_normal_to_circle_plane: list = [1,0,0], comment: str = '', params: dict = None, model = Model) 11 | Line.Spline(no: int = 1, nodes_no: str = '1 3 5', comment: str = '', params: dict = None, model = Model) 12 | 13 | 14 | this models openings and holes in surfaces: Opening(no: int = 1, lines_no: str = '1 2 3 4', comment: str = '', params: dict = None, model = Model) 15 | 16 | this is for defining line supports: 17 | LineSupport(no: int = 1, lines_no: str = '1 2', support_type = LineSupportType.HINGED, comment: str = '', params: dict = None, model = Model) 18 | The line support_type can be FIXED, HINGED, SLIDING_IN_X_AND_Y, SLIDING_IN_X, SLIDING_IN_Y, SLIDING_IN_Z, FREE 19 | 20 | this is for defining nodal supports: 21 | NodalSupport(no: int = 1, nodes_no: str = '1 2', support = NodalSupportType.HINGED, comment: str = '', params: dict = None, model = Model) 22 | The nodal support_type can be FIXED, HINGED, ROLLER, ROLLER_IN_X, ROLLER_IN_Y, ROLLER_IN_Z, FREE 23 | 24 | create only neccessary nodes, lines etc! 25 | if the user does not specify, assume the positive heigt in negative global z direction. 26 | 27 | 28 | This is an example of the Geometry section: 29 | 30 | # ---- Geometry Sec ---- 31 | Node(1, 1, 0,0) 32 | 33 | Line.Circle(1, [0,0,0], 3, [0,0,1]) 34 | 35 | LineSupport(1, '1', LineSupportType.HINGED) 36 | 37 | 38 | -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/introduction.txt: -------------------------------------------------------------------------------- 1 | I want you to help me as a code assistant to generate a calculation model in the finite element program Dlubal RFEM related to: {placeholder} Your task is to write a Python input file. The input file is divided in different sections, where the order is important: Material, Geometry, Cross Sections, Loads, Solver and Results. 2 | 3 | Before the Material section, the RFEM model has to be instanciated via "Model(True, NAME)", where NAME is a string of the file name ending with ".rf6". Then we always need the code "Model.clientModel.service.begin_modification()" to allow modification of the RFEM model via Python. 4 | 5 | In the Cross Section part, we define the cross sections used in the project. 6 | In the Material section, we define the materials used in the project. A material is defined via an integer and a string for the name of the material. 7 | 8 | The task of the Geometry section is to define the geometric elements of the model, such as nodes, lines, areas, beams and plates, and to assign the materials and cross sections to these elements previously defined. In addition, in this section we will assign the support conditions of the structure. 9 | 10 | The Loads section organizes the load cases and the assignment of the loads to the geometric objects. Load cases are addressed via a number and named via a string. A list, containing a boolean and a direction vector indicates, if self-weight is acting in what direction. 11 | 12 | The solver calculates the static and dynamic effects of general loading on any type of structure. 13 | 14 | The Results section is used to extract certain results from the analysis for further inspection and reporting. 15 | 16 | Each section of the Python input file related to a subsection begins with an indicating line. For the Material example, it would be # ---- Material Sec ----. 17 | 18 | I will provide you with information about the syntax of each Python section and an example of it in JSON format: ["Record name" : ["Input keyword 1": "Value", "Input keyword 1": "Value, ...]]. 19 | 20 | Now wait for further instructions and do not yet start coding. We will process the input in steps according to each section. Keep your responses outside the code sections brief and do never provide haluzinated code or whole blocks of code. -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/load.txt: -------------------------------------------------------------------------------- 1 | Now define the Load section. {placeholder} 2 | This is the syntax of the Load section: 3 | 4 | LoadCase(no: int = 1, name: str = 'Self-weight', self_weight: list = [True, 0.0, 0.0, 1.0], imperfection_case: int = None, structure_modification: int = None, comment: str = 'Comment', params: dict = None, model = Model) 5 | 6 | Use per default self_weight = [True, 0.0, 0.0, 1.0]. If the user explicitely does not want self weight, set self_weight: list = [True] 7 | 8 | NodalLoad(no: int = 1, load_case_no: int = 1, nodes_no: str= '1', load_direction= NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, magnitude: float = 0.0, comment: str= '', params: dict= None, model = Model) 9 | 10 | MemberLoad(no: int = 1, load_case_no: int = 1,members_no: str = '1', load_direction = MemberLoadDirection.LOAD_DIRECTION_LOCAL_Z, magnitude: float = 2000, comment: str = '', params: dict = None, model = Model) 11 | 12 | SurfaceLoad(no: int = 1, load_case_no: int = 1, surface_no: str = '1', magnitude: float = 1.0, comment: str = '', params: dict = None, model = Model) 13 | 14 | SurfaceLoad has multiple methods, e.g.: 15 | SurfaceLoad.Force(no: int = 1, load_case_no: int = 1, surface_no: str = '1', load_direction = SurfaceLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, load_distribution = SurfaceLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, load_parameter: list = None, comment: str = '', params: dict = None, model = Model) 16 | 17 | SurfaceLoad.Temperature(no: int = 1, load_case_no: int = 1, surface_no: str = '1', load_distribution = SurfaceLoadDistribution.LOAD_DISTRIBUTION_UNIFORM, load_parameter: list = None, comment: str = '', params: dict = None, model = Model) 18 | 19 | 20 | Always multiply the user provided load magnitude with 1000 but do not comment. 21 | 22 | 23 | This is an example of the Load section: 24 | 25 | # ---- Loads Sec ---- 26 | 27 | LoadCase() 28 | 29 | SurfaceLoad.Force(no = 1, load_case_no = 1, surface_no = '1 2', load_direction = SurfaceLoadDirection.LOAD_DIRECTION_LOCAL_Z, load_distribution = SurfaceLoadDistribution.LOAD_DISTRIBUTION_VARYING_IN_Z, load_parameter = [[-load_height, 0],[0, 9.81 * load_height * 1000]]) 30 | -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/material.txt: -------------------------------------------------------------------------------- 1 | Now we define the Material section. {placeholder} 2 | This is the syntax of the Material section: 3 | 4 | Material(no: int = 1, name: str = 'S235', comment: str = '', params: dict = None, model = Model) 5 | 6 | avoid to fill params when not requested by the user. 7 | 8 | 9 | This is an example of the Material section: 10 | 11 | # ---- Material Sec ---- 12 | Material(1, "S235") 13 | -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/results.txt: -------------------------------------------------------------------------------- 1 | Now define the Results section. {placeholder} 2 | This is the syntax of the Results section: 3 | 4 | GetDesignOverview(model = Model) 5 | 6 | GetResultTableParameters(results) 7 | 8 | ConvertResultsToListOfDct(results, includeBase = False) 9 | 10 | GetMinValue(structured_results, parameter) 11 | GetMaxValue(structured_results, parameter) 12 | 13 | ResultTables() 14 | 15 | 16 | This is an example of the Results section: 17 | 18 | # ---- Results Sec ---- 19 | global maxStress 20 | maxStressinit = ResultTables.SurfacesEquivalentStressesMises() 21 | maxStress = GetMaxValue(maxStressinit, 'equivalent_stresses_sigma_eqv_max') / 1000000 22 | -------------------------------------------------------------------------------- /Examples/GPT_Tank/templates/solver.txt: -------------------------------------------------------------------------------- 1 | Now define the Solver section. {placeholder} 2 | This is the syntax of the Solver section: 3 | 4 | # ---- Solver Sec ---- 5 | Model.clientModel.service.finish_modification() 6 | 7 | Calculate_all() -------------------------------------------------------------------------------- /Examples/GetRFEMData/ExcelGlobalParamTest.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/GetRFEMData/ExcelGlobalParamTest.xlsx -------------------------------------------------------------------------------- /Examples/GetRFEMData/GetOptimizedValues.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | baseName = os.path.basename(__file__) 4 | dirName = os.path.dirname(__file__) 5 | print('basename: ', baseName) 6 | print('dirname: ', dirName) 7 | sys.path.append(dirName + r'/../..') 8 | from RFEM.initModel import Model, CheckIfMethodOrTypeExists 9 | 10 | if __name__ == "__main__": 11 | 12 | Model() 13 | if CheckIfMethodOrTypeExists(Model.clientModel,'get_optimized_formula_parameters'): 14 | 15 | optimizationResults = Model.clientModel.service.get_optimized_formula_parameters() 16 | if len(optimizationResults) > 0: 17 | for i in range(0, len(optimizationResults.row)): 18 | for j in range(0, len(optimizationResults.row[i].section)): 19 | 20 | if hasattr(optimizationResults.row[i].section[j], 'top_text'): 21 | print(optimizationResults.row[i].section[j].top_text) 22 | 23 | for k in range(0, len(optimizationResults.row[i].section[j].elements[0])): 24 | print(optimizationResults.row[i].section[j].elements[0][k].column_name + 25 | " " + optimizationResults.row[i].section[j].elements[0][k].value) 26 | -------------------------------------------------------------------------------- /Examples/GetRFEMData/GlobalParametersAndFormulas.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | baseName = os.path.basename(__file__) 4 | dirName = os.path.dirname(__file__) 5 | print('basename: ', baseName) 6 | print('dirname: ', dirName) 7 | sys.path.append(dirName + r'/../..') 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.enums import ObjectTypes, GlobalParameterUnitGroup, GlobalParameterDefinitionType 11 | from RFEM.globalParameter import GlobalParameter 12 | from RFEM.BasicObjects.node import Node 13 | 14 | import xlwings as xw 15 | 16 | dirname = os.path.join(os.getcwd(), os.path.dirname(__file__)) 17 | path = os.path.join(dirname,'ExcelGlobalParamTest.xlsx') 18 | wb = xw.Book(path) 19 | 20 | inputSheet = wb.sheets('Inputs') 21 | 22 | formula = inputSheet["B2"].formula # Test_1+Test_2 23 | 24 | Model(True, "ExcelGlobalParams.rf6") 25 | Model.clientModel.service.begin_modification() 26 | 27 | GlobalParameter.AddParameter( 28 | no = 1, 29 | name = 'Test_1', 30 | symbol = 'Test_1', 31 | unit_group = GlobalParameterUnitGroup.LENGTH, 32 | definition_type = GlobalParameterDefinitionType.DEFINITION_TYPE_FORMULA, 33 | definition_parameter = ['1+1'], 34 | comment = 'Comment_1') 35 | 36 | GlobalParameter.AddParameter( 37 | no = 2, 38 | name = 'Test_2', 39 | symbol = 'Test_2', 40 | unit_group = GlobalParameterUnitGroup.LOADS_FORCE_PER_UNIT_LENGTH, 41 | definition_type = GlobalParameterDefinitionType.DEFINITION_TYPE_VALUE, 42 | definition_parameter = [2000], 43 | comment = 'Comment_2') 44 | 45 | Node(1) 46 | GlobalParameter.SetFormula(ObjectTypes.E_OBJECT_TYPE_NODE, 1, 1, "coordinate_1", formula) 47 | 48 | Model.clientModel.service.finish_modification() 49 | 50 | get_formula = GlobalParameter.GetFormula(ObjectTypes.E_OBJECT_TYPE_NODE, 1, 1, "coordinate_1") 51 | coord_1 = Node.GetNode(1).coordinate_1 52 | assert coord_1 == 2002 53 | 54 | outputSheet = wb.sheets('Nodes') 55 | outputSheet["B2"].value = coord_1 56 | 57 | wb.save(path) 58 | wb.app.quit() 59 | -------------------------------------------------------------------------------- /Examples/LinkUSGS/README.md: -------------------------------------------------------------------------------- 1 | ## How to Run USGS Link Web App 2 | 3 | - First, install all prerequisites like _streamlit_, _plotly.express_ or _PIL_ in your Python env. using pip. If you skip this step, you'll be prompted automatically. 4 | 5 | ```pip install streamlit plotly.express pillow --user``` 6 | 7 | - Open your terminal and run following command. 8 | 9 | ```python -m streamlit run .\Examples\LinkUSGS\UsgsRFEMLink.py``` 10 | 11 | - Web application will start automatically in your web browser on address http://localhost:8501. 12 | 13 | ![image](https://user-images.githubusercontent.com/61163577/215473458-fefab8d1-6d11-4348-99a7-486e9d09f86f.png) 14 | -------------------------------------------------------------------------------- /Examples/LinkUSGS/assets/logo_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/LinkUSGS/assets/logo_round.png -------------------------------------------------------------------------------- /Examples/RSectionExample/Demo_import_from_rsection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | import os 4 | import sys 5 | baseName = os.path.basename(__file__) 6 | dirName = os.path.dirname(__file__) 7 | print('basename: ', baseName) 8 | print('dirname: ', dirName) 9 | sys.path.append(dirName + r'/../../') 10 | 11 | from RFEM.enums import NodalSupportType, NodalLoadDirection 12 | from RFEM.initModel import Model, Calculate_all 13 | from RFEM.BasicObjects.material import Material 14 | from RFEM.Tools.sectionDialogue import CreateSectionFromRsectionFile 15 | from RFEM.BasicObjects.section import Section 16 | from RFEM.BasicObjects.node import Node 17 | from RFEM.BasicObjects.member import Member 18 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 19 | from RFEM.LoadCasesAndCombinations.loadCase import LoadCase 20 | from RFEM.Loads.nodalLoad import NodalLoad 21 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 22 | 23 | if __name__ == '__main__': 24 | 25 | filepath = os.path.join(os.path.dirname(__file__), 'thin_walled.rsc') 26 | f = float(input('Force in kN: ')) 27 | l = float(input('Length in m: ')) 28 | 29 | Model(True, "Demo_Rsection") # create new Model Demo_Rsection 30 | Model.clientModel.service.delete_all() 31 | Model.clientModel.service.begin_modification() 32 | 33 | Material(1, 'S275') 34 | CreateSectionFromRsectionFile(1, filepath) 35 | Section(1, None, 1) 36 | 37 | Node(1, 0.0, 0.0, 0.0) 38 | Node(2, l, 0.0, 0.0) 39 | 40 | Member(1, 1, 2, 0.0, 1, 1) 41 | 42 | NodalSupport(1, '1', NodalSupportType.FIXED) 43 | 44 | StaticAnalysisSettings.GeometricallyLinear(1, "Linear") 45 | StaticAnalysisSettings.SecondOrderPDelta(2, "SecondOrder") 46 | StaticAnalysisSettings.LargeDeformation(3, "LargeDeformation") 47 | 48 | LoadCase(1, 'Self-Weight', [True, 0.0, 0.0, 1.0]) 49 | 50 | NodalLoad(1, 1, '2', NodalLoadDirection.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, f*1000) 51 | 52 | Model.clientModel.service.finish_modification() 53 | 54 | Calculate_all() 55 | -------------------------------------------------------------------------------- /Examples/RSectionExample/thin_walled.rsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/RSectionExample/thin_walled.rsc -------------------------------------------------------------------------------- /Examples/ScriptGenerator/README.md: -------------------------------------------------------------------------------- 1 | # How to use the script generators 2 | Both the WSScriptSenerator and XMLScriptGenerator examples are intended for users who want to obtain a copy of the RFEM model in the form of an executable script. It reads all data stored in the model and creates scripts, reducing development time to a minimum. The examples use 2 sources. Either XML generated from RFEM or Web Services. 3 | 4 | Prerequisite is to set the correct model name in WS(XML)ScripGenerator.py, line 12. 5 | 6 | Running both examples will generate a complete script with the necessary components. The script also contains begin_modification, finish_modification and creating a model with a default name. Empty values or lists and null values are deleted. 7 | -------------------------------------------------------------------------------- /Examples/ScriptGenerator/WSScripGenerator.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | import os 4 | import sys 5 | 6 | rfemDir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) 7 | sys.path.append(rfemDir) 8 | from RFEM.initModel import Model 9 | from RFEM.Tools.GetObjectNumbersByType import GetAllObjects 10 | 11 | # Define name of the model from which the data should be exported 12 | model_name = 'test.rf6' 13 | folderPath = '' 14 | 15 | # Connect to model 16 | model = Model(False, model_name) 17 | 18 | # Constant imports 19 | lines = ['import sys\n', 20 | 'sys.path.append("'+rfemDir.replace('\\', '/')+'")\n', 21 | 'from RFEM.enums import *\n', 22 | 'from RFEM.initModel import *\n', 23 | 'from RFEM.dataTypes import inf, nan\n', 24 | '\n'] 25 | 26 | objects, importObjects = GetAllObjects() 27 | lines += objects 28 | 29 | # Add imports to 'lines' 30 | for i,v in enumerate(importObjects): 31 | lines.insert(i+6, v) 32 | 33 | modelNameStr = "" 34 | if '.' in model_name: 35 | idx = model_name.rfind('.') 36 | postfix = model_name[idx:] 37 | modelNameStr = '"'+model_name[:idx-1]+'_gen'+postfix+'"' 38 | else: 39 | modelNameStr = '"'+model_name+'_gen.rf6"' 40 | 41 | # Add mandatory steps 42 | lines.insert(6+len(importObjects), '\n') 43 | lines.insert(6+len(importObjects)+1, 'Model(True,'+modelNameStr+')\n') 44 | lines.insert(6+len(importObjects)+2, 'Model.clientModel.service.begin_modification()\n') 45 | lines.insert(6+len(importObjects)+3, '\n') 46 | 47 | # Add finish modification and list all excluded objects 48 | lines.append('\n') 49 | lines.append('Model.clientModel.service.finish_modification()\n') 50 | lines.append('\n') 51 | 52 | # Create file and write data 53 | if not folderPath: 54 | folderPath = os.path.dirname(__file__) 55 | 56 | model_name = model_name[:-3]+'py' 57 | with open(folderPath+'/'+model_name, 'w', encoding='utf-8') as f: 58 | f.writelines(lines) 59 | f.close() 60 | -------------------------------------------------------------------------------- /Examples/SteelDesign/README.md: -------------------------------------------------------------------------------- 1 | # Steel Design Excel Integration 2 | 3 | Python version : Python 3.10 (recommended) 4 | *`🛈` Note: `xlwings` is not supported by `Python 3.11` at the moment.* 5 | 6 | ## Step by step guide 7 | 8 | Here, you can find the step by step process to use Steel Design Example using MS Excel. 9 | 10 | 1. [Install numpy](https://numpy.org/install/) 11 | 2. [Install pandas](https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html) 12 | 3. [Install xlwings](https://docs.xlwings.org/en/stable/installation.html#id2) 13 | 4. [Install xlwings Add-in](https://docs.xlwings.org/en/stable/installation.html#add-in) 14 | 5. Add Python Interpreter 15 | 6. Run the Script 16 | 17 | ## Installing numpy 18 | 19 | You can install NumPy with: 20 | 21 | ``` 22 | pip install numpy 23 | ``` 24 | 25 | ## Installing pandas 26 | 27 | pandas can be installed via pip from [PyPI](https://pypi.org/project/pandas/). 28 | 29 | > ``🛈`` **Note**: 30 | You must have `pip>=19.3` to install from PyPI. 31 | 32 | ``` 33 | pip install pandas 34 | ``` 35 | 36 | Python version support : Officially Python 3.8, 3.9, 3.10 and 3.11. 37 | 38 | ## Installing xlwings 39 | 40 | xlwings comes pre-installed with 41 | 42 | * [Anaconda](https://www.anaconda.com/products/distribution) (Windows and macOS) 43 | 44 | * [WinPython](https://winpython.github.io/) (Windows only) Make sure not to take the dot version as this only contains Python. 45 | 46 | You can also install it with pip: 47 | 48 | ``` 49 | pip install xlwings 50 | ``` 51 | 52 | or conda: 53 | ``` 54 | conda install xlwings 55 | ``` 56 | 57 | ## Installing xlwings Add-in 58 | 59 | To install the add-in, use the command line client: 60 | ``` 61 | xlwings addin install 62 | ``` 63 | 64 | > ``🛈`` **Note**: 65 | The ribbon of the add-in is compatible with `Excel >= 2007 on Windows and >= 2016 on macOS`. On macOS, all UDF related functionality is not available. 66 | 67 | > ``🛈`` **Note**: 68 | The add-in is password protected with the password `xlwings`. For debugging or to add new extensions, you need to unprotect it. Alternatively, you can also install the add-in via `xlwings addin install --unprotected`. 69 | 70 | ## Adding Python Interpreter 71 | 72 | Add your local ``python.exe`` path into interpreter in xlwings tab. 73 | 74 | For example : ``C:\Python310\python.exe`` 75 | 76 | ![xlwingsInterpreter](img/xlwingsInterpreter.png) 77 | 78 | ## Run the Script 79 | 80 | To run the python code press ``Run main`` in xlwings ribbon. 81 | 82 | ![xlwingsButton](img/xlwingsRun.png) 83 | -------------------------------------------------------------------------------- /Examples/SteelDesign/SteelDesignExcel.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/SteelDesign/SteelDesignExcel.xlsm -------------------------------------------------------------------------------- /Examples/SteelDesign/img/xlwingsInterpreter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/SteelDesign/img/xlwingsInterpreter.png -------------------------------------------------------------------------------- /Examples/SteelDesign/img/xlwingsRun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/SteelDesign/img/xlwingsRun.png -------------------------------------------------------------------------------- /Examples/TankWebApp/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TankWebApp/assets/logo.png -------------------------------------------------------------------------------- /Examples/TankWebApp/export.vtk: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Examples/TankWebApp/export/export.mtl: -------------------------------------------------------------------------------- 1 | # wavefront mtl file written by the visualization toolkit 2 | 3 | newmtl mtl1 4 | Ka 0 0 0 5 | Kd 1 1 1 6 | Ks 0 0 0 7 | Ns 100 8 | Tr 1 9 | illum 3 10 | -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_1.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_2.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_3.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_4.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_5.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_6.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/diag_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/diag_7.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/logo_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/logo_round.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/truss_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/truss_1.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/truss_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/truss_2.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/truss_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/truss_3.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/truss_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/truss_4.png -------------------------------------------------------------------------------- /Examples/TrussGenerator_2D/sources/truss_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/Examples/TrussGenerator_2D/sources/truss_5.png -------------------------------------------------------------------------------- /Examples/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Dlubal Software 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include RFEM/Reports/favicon32.png 2 | include RFEM/Reports/htmlStyles.css 3 | include RFEM/Reports/htmlScript.js 4 | 5 | 6 | -------------------------------------------------------------------------------- /PythonWSClient.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /RFEM/AluminumDesign/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/RFEM/AluminumDesign/__init__.py -------------------------------------------------------------------------------- /RFEM/AluminumDesign/aluminumSLSConfiguration.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class AluminumDesignSLSConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'SLS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Aluminum Design Serviceability Limit State Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Aluminum Design Serviceability Limit State Configurations 26 | clientObject = model.clientModel.factory.create('ns0:aluminum_design_sls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # ULS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Aluminum Design SLS Configuration to Client Model 67 | model.clientModel.service.set_aluminum_design_sls_configuration(clientObject) 68 | -------------------------------------------------------------------------------- /RFEM/AluminumDesign/aluminumULSConfiguration.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class AluminumDesignULSConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'ULS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Aluminum Design Ultimate Limit State Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Aluminum Design Ultimate Limit State Configurations 26 | clientObject = model.clientModel.factory.create('ns0:aluminum_design_uls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # ULS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Aluminum Design ULS Configuration to Client Model 67 | model.clientModel.service.set_aluminum_design_uls_configuration(clientObject) 68 | 69 | -------------------------------------------------------------------------------- /RFEM/BasicObjects/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/BasicObjects/opening.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString, ConvertStrToListOfInt 2 | from RFEM.enums import ObjectTypes 3 | 4 | class Opening(): 5 | def __init__(self, 6 | no: int = 1, 7 | lines_no: str = '1 2 3 4', 8 | comment: str = '', 9 | params: dict = None, 10 | model = Model): 11 | 12 | ''' 13 | Args: 14 | no (int): Opening Tag 15 | lines_no (str): Numbers of Lines defining Opening 16 | comment (str, optional): Comments 17 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 18 | model (RFEM Class, optional): Model to be edited 19 | ''' 20 | 21 | # Client model | Opening 22 | clientObject = model.clientModel.factory.create('ns0:opening') 23 | 24 | # Clears object atributes | Sets all atributes to None 25 | clearAttributes(clientObject) 26 | 27 | # Opening No. 28 | clientObject.no = no 29 | 30 | # Boundary Lines No. 31 | clientObject.boundary_lines = ConvertToDlString(lines_no) 32 | 33 | # Comment 34 | clientObject.comment = comment 35 | 36 | # Adding optional parameters via dictionary 37 | if params: 38 | for key in params: 39 | clientObject[key] = params[key] 40 | 41 | # Delete None attributes for improved performance 42 | deleteEmptyAttributes(clientObject) 43 | 44 | # Add Opening to client model 45 | model.clientModel.service.set_opening(clientObject) 46 | 47 | @staticmethod 48 | def DeleteOpening(openings_no: str = '1 2', model = Model): 49 | 50 | ''' 51 | Args: 52 | openings_no (str): Numbers of Openings to be deleted 53 | model (RFEM Class, optional): Model to be edited 54 | ''' 55 | 56 | # Delete from client model 57 | for opening in ConvertStrToListOfInt(openings_no): 58 | model.clientModel.service.delete_object(ObjectTypes.E_OBJECT_TYPE_OPENING.name, opening) 59 | 60 | @staticmethod 61 | def GetOpening(object_index: int = 1, model = Model): 62 | 63 | ''' 64 | Args: 65 | obejct_index (int): Opening Index 66 | model (RFEM Class, optional): Model to be edited 67 | ''' 68 | 69 | # Get Opening from client model 70 | return model.clientModel.service.get_opening(object_index) 71 | -------------------------------------------------------------------------------- /RFEM/BasicObjects/section.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertStrToListOfInt 2 | from RFEM.enums import ObjectTypes 3 | 4 | class Section(): 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'IPE 300', 8 | material_no: int = 1, 9 | comment: str = '', 10 | params: dict = None, 11 | model = Model): 12 | 13 | ''' 14 | Args: 15 | no (int): Section Tag 16 | name (str): Name of Desired Section (As Named in RFEM Database) 17 | material_no (int): Tag of Material assigned to Section 18 | comment (str, optional): Comments 19 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 20 | model (RFEM Class, optional): Model to be edited 21 | ''' 22 | 23 | # Client model | Section 24 | clientObject = model.clientModel.factory.create('ns0:section') 25 | 26 | # Clears object atributes | Sets all atributes to None 27 | clearAttributes(clientObject) 28 | 29 | # Section No. 30 | clientObject.no = no 31 | 32 | # Section nNme 33 | clientObject.name = name 34 | 35 | # Material No. 36 | clientObject.material = material_no 37 | 38 | # Comment 39 | clientObject.comment = comment 40 | 41 | # Adding optional parameters via dictionary 42 | if params: 43 | for key in params: 44 | clientObject[key] = params[key] 45 | 46 | # Delete None attributes for improved performance 47 | deleteEmptyAttributes(clientObject) 48 | 49 | # Add Section to client model 50 | model.clientModel.service.set_section(clientObject) 51 | 52 | @staticmethod 53 | def DeleteSection(sections_no: str = '1 2', model = Model): 54 | 55 | ''' 56 | Args: 57 | sections_no (str): Numbers of Sections to be deleted 58 | model (RFEM Class, optional): Model to be edited 59 | ''' 60 | 61 | # Delete from client model 62 | for section in ConvertStrToListOfInt(sections_no): 63 | model.clientModel.service.delete_object(ObjectTypes.E_OBJECT_TYPE_SECTION.name, section) 64 | 65 | @staticmethod 66 | def GetSection(object_index: int = 1, model = Model): 67 | 68 | ''' 69 | Args: 70 | obejct_index (int): Section Index 71 | model (RFEM Class, optional): Model to be edited 72 | ''' 73 | 74 | # Get Section from client model 75 | return model.clientModel.service.get_section(object_index) 76 | -------------------------------------------------------------------------------- /RFEM/Calculate/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/ConcreteDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/DynamicLoads/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/RFEM/DynamicLoads/__init__.py -------------------------------------------------------------------------------- /RFEM/GuideObjects/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/RFEM/GuideObjects/__init__.py -------------------------------------------------------------------------------- /RFEM/Imperfections/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/ImportExport/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/ImportExport/imports.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | # In order to use connectionGlobals we need to adjust the sys path 4 | PROJECT_ROOT = os.path.abspath(os.path.join( 5 | os.path.dirname(__file__), 6 | os.pardir) 7 | ) 8 | 9 | sys.path.append(PROJECT_ROOT) 10 | from RFEM.initModel import Model 11 | from RFEM import connectionGlobals 12 | 13 | def importFrom(targetFilePath: str): 14 | ''' 15 | Allowed file extensions are .xml, .saf and .xlsx. 16 | 17 | Args: 18 | targetFilePath (string): Destination path to the file 19 | ''' 20 | connectionGlobals.client.service.import_from(targetFilePath) 21 | head, tail = os.path.split(targetFilePath) 22 | if '.' in tail: 23 | tail = tail.split('.')[0] 24 | Model(False, tail) 25 | 26 | def getConversionTables(): 27 | ''' 28 | Get conversion tables. 29 | ''' 30 | return connectionGlobals.client.service.get_conversion_tables() 31 | 32 | def setConversionTables(ConversionTables): 33 | ''' 34 | Set conversion tables. 35 | 36 | Args: 37 | ConversionTables (ns0:ConversionTables): Conversion tables structure 38 | ''' 39 | connectionGlobals.client.service.set_conversion_tables(ConversionTables) 40 | 41 | def getSAFSettings(): 42 | ''' 43 | Get SAF import/export settings. 44 | ''' 45 | return connectionGlobals.client.service.get_saf_settings() 46 | 47 | def setSAFSettings(SafConfiguration): 48 | ''' 49 | Set SAF import/export settings. 50 | 51 | Args: 52 | SafConfiguration (ns0:SafConfiguration) SAF settings obtained by getSAFSettings() 53 | ''' 54 | connectionGlobals.client.service.set_saf_settings(SafConfiguration) 55 | -------------------------------------------------------------------------------- /RFEM/LoadCasesAndCombinations/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/LoadCasesAndCombinations/designSituation.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes 2 | from RFEM.enums import DesignSituationType 3 | 4 | class DesignSituation(): 5 | 6 | def __init__(self, 7 | no: int = 1, 8 | design_situation_type = DesignSituationType.DESIGN_SITUATION_TYPE_A_ACCIDENTAL, 9 | active: bool = True, 10 | name = None, 11 | comment: str = '', 12 | params: dict = None, 13 | model = Model): 14 | 15 | """ 16 | Args: 17 | no (int): Design Situation Tag 18 | design_situation_type (enum): Design Situation Type Enumeration 19 | active (bool): Enable/Disable Design Situation Activity 20 | name (str, optional): User-Defined Name 21 | comment (str, optional): Comments 22 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 23 | model (RFEM Class, optional): Model to be edited 24 | """ 25 | 26 | # Client model | Design Situation 27 | clientObject = model.clientModel.factory.create('ns0:design_situation') 28 | 29 | # Clears object atributes | Sets all atributes to None 30 | clearAttributes(clientObject) 31 | 32 | # Design Situation No. 33 | clientObject.no = no 34 | 35 | # Design Situation Name 36 | if name: 37 | clientObject.user_defined_name_enabled = True 38 | clientObject.name = name 39 | 40 | # Design Situation Active 41 | clientObject.active = active 42 | 43 | # Design Situation Type 44 | clientObject.design_situation_type = design_situation_type.name 45 | 46 | # Design Situation Comment 47 | clientObject.comment = comment 48 | 49 | # Adding optional parameters via dictionary 50 | if params: 51 | for key in params: 52 | clientObject[key] = params[key] 53 | 54 | # Delete None attributes for improved performance 55 | deleteEmptyAttributes(clientObject) 56 | 57 | # Add Design Situation to client model 58 | model.clientModel.service.set_design_situation(clientObject) 59 | -------------------------------------------------------------------------------- /RFEM/Loads/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/Loads/imposedLineDeformation.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class ImposedLineDeformation(): 4 | 5 | LineDeformationParams = {'imposed_displacement_line_start_x' : 0.0, 6 | 'imposed_displacement_line_start_y' : 0.0, 7 | 'imposed_displacement_line_start_z': 0.003, 8 | 'imposed_rotation_line_start' : 0.0, 9 | 'imposed_displacement_line_end_x': 0.0, 10 | 'imposed_displacement_line_end_y': 0.0, 11 | 'imposed_displacement_line_end_z': 0.0002, 12 | 'imposed_rotation_line_end': 0.0} 13 | 14 | def __init__(self, 15 | no: int = 1, 16 | load_case_no: int = 1, 17 | line_no: str = '1', 18 | comment: str = '', 19 | params: dict = LineDeformationParams, 20 | model = Model): 21 | 22 | ''' 23 | Args: 24 | no (int): Load Tag 25 | load_case_no (int): Assigned Load Case 26 | line_no (str): Assigned line(s) 27 | comment (str, optional): Comments 28 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 29 | model (RFEM Class, optional): Model to be edited 30 | ''' 31 | 32 | # Client model | Imposed Line Deformation 33 | clientObject = model.clientModel.factory.create('ns0:imposed_line_deformation') 34 | 35 | # Clears object atributes | Sets all atributes to None 36 | clearAttributes(clientObject) 37 | 38 | # Load No. 39 | clientObject.no = no 40 | 41 | # Load Case No. 42 | clientObject.load_case = load_case_no 43 | 44 | # Line No. 45 | clientObject.lines = ConvertToDlString(line_no) 46 | 47 | # Comment 48 | clientObject.comment = comment 49 | 50 | # Adding optional parameters via dictionary 51 | if params: 52 | for key in params: 53 | clientObject[key] = params[key] 54 | 55 | # Delete None attributes for improved performance 56 | deleteEmptyAttributes(clientObject) 57 | 58 | # Add Nodal Support to client model 59 | model.clientModel.service.set_imposed_line_deformation(load_case_no, clientObject) 60 | -------------------------------------------------------------------------------- /RFEM/Loads/imposedNodalDeformation.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class ImposedNodalDeformation(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | load_case_no: int = 1, 8 | node_no: str = '1', 9 | load_parameter: list = None, 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | ''' 15 | Args: 16 | no (int): Load Tag 17 | load_case_no (int): Assigned Load Case 18 | node_no (str): Assigned node(s) 19 | load_parameter (list): Load Parameters List 20 | load_parameter = [imposed_displacement_x, imposed_displacement_y, imposed_displacement_z, imposed_rotation_x, imposed_rotation_y imposed_rotation_z] 21 | comment (str, optional): Comments 22 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 23 | model (RFEM Class, optional): Model to be edited 24 | ''' 25 | # Client model | Imposed Nodal Deformation 26 | clientObject = model.clientModel.factory.create('ns0:imposed_nodal_deformation') 27 | 28 | # Clears object attributes | Sets all attributes to None 29 | clearAttributes(clientObject) 30 | 31 | # Load No. 32 | clientObject.no = no 33 | 34 | # Load Case No. 35 | clientObject.load_case = load_case_no 36 | 37 | # Assigned Node No. 38 | clientObject.nodes = ConvertToDlString(node_no) 39 | 40 | # Load Parameter 41 | clientObject.imposed_displacement_x = load_parameter[0] 42 | clientObject.imposed_displacement_y = load_parameter[1] 43 | clientObject.imposed_displacement_z = load_parameter[2] 44 | 45 | clientObject.imposed_rotation_x = load_parameter[3] 46 | clientObject.imposed_rotation_y = load_parameter[4] 47 | clientObject.imposed_rotation_z = load_parameter[5] 48 | 49 | # Comment 50 | clientObject.comment = comment 51 | 52 | # Adding optional parameters via dictionary 53 | if params: 54 | for key in params: 55 | clientObject[key] = params[key] 56 | 57 | # Delete None attributes for improved performance 58 | deleteEmptyAttributes(clientObject) 59 | 60 | # Add Imposed Nodal Deformation to client model 61 | model.clientModel.service.set_imposed_nodal_deformation(load_case_no, clientObject) 62 | -------------------------------------------------------------------------------- /RFEM/Reports/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/Reports/favicon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/RFEM/Reports/favicon32.png -------------------------------------------------------------------------------- /RFEM/Reports/htmlScript.js: -------------------------------------------------------------------------------- 1 | function showPanel(){ 2 | var framePanels = document.getElementsByTagName("iframe"); 3 | var datalist = document.getElementById('filter'); 4 | var searchField = document.getElementById('fl'); 5 | var searchFieldTableName = searchField.value; 6 | for (let i = 0; i < datalist.options.length; i++) { 7 | if (searchFieldTableName == datalist.options[i].label){ 8 | framePanels[i].style.display="block"; 9 | } 10 | else{ 11 | framePanels[i].style.display="none"; 12 | } 13 | } 14 | searchField.blur(); 15 | }; 16 | function switchButtonDown(){ 17 | var datalist = document.getElementById('filter'); 18 | var searchField = document.getElementById('fl'); 19 | var searchFieldTableName = searchField.value; 20 | var index = 0; 21 | for (let i = 0; i < datalist.options.length; i++) { 22 | if (searchFieldTableName == datalist.options[i].label){ 23 | index = i; 24 | break; 25 | } 26 | } 27 | index = index - 1; 28 | index = Math.max(0, index); 29 | searchField.value = datalist.options[index].label; 30 | showPanel(); 31 | }; 32 | function switchButtonUp(){ 33 | var datalist = document.getElementById('filter'); 34 | var searchField = document.getElementById('fl'); 35 | var searchFieldTableName = searchField.value; 36 | var index = 0; 37 | for (let i = 0; i < datalist.options.length; i++) { 38 | if (searchFieldTableName == datalist.options[i].label){ 39 | index = i; 40 | break; 41 | } 42 | } 43 | index = index + 1 44 | index = Math.min(datalist.options.length-1, index); 45 | searchField.value = datalist.options[index].label; 46 | showPanel(); 47 | }; 48 | function atTheEnd(){ 49 | var datalist = document.getElementById('filter'); 50 | var searchField = document.getElementById('fl'); 51 | searchField.value = datalist.options[0].label; 52 | showPanel(); 53 | }; 54 | -------------------------------------------------------------------------------- /RFEM/Reports/htmlStyles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: white; 3 | color: black; 4 | font-family: sans-serif; 5 | } 6 | table{ 7 | width: 100%; 8 | margin: auto; 9 | font-size: 13px; 10 | } 11 | table, th, td{ 12 | border: 1px solid #d7d4d4; 13 | border-collapse: separate; /* Don't collapse */ 14 | border-spacing: 0; 15 | } 16 | th{ 17 | padding: 5px; 18 | } 19 | td{ 20 | padding: 5px; 21 | min-width: 40px; 22 | } 23 | tr:nth-child(even) {background-color: #fffae6;} 24 | thead{ 25 | position: sticky; 26 | top: 0; 27 | background-color: white; 28 | } 29 | .tabContainer{ 30 | padding-top:10px; 31 | } 32 | .button { 33 | background-color: #D4E6F1; /* Blue Gray */ 34 | border: none; 35 | color: black; 36 | padding: 6px 3px; 37 | font-family: sans-serif; 38 | text-align: center; 39 | text-decoration: none; 40 | display: inline-block; 41 | font-size: 11px; 42 | transition-duration: 0.2s; 43 | position: relative; 44 | display: inline-block; 45 | } 46 | .button:hover { 47 | background-color: #d7d4d4; 48 | color: black; 49 | } 50 | .title{ 51 | font-family: sans-serif; 52 | color: #ECF0F1; 53 | text-align: top; 54 | } 55 | progress { 56 | position: absolute; 57 | left: 50%; 58 | top: 50%; 59 | } 60 | input { 61 | /*border: 1px solid transparent;*/ 62 | height: 25px; 63 | width: 500px; 64 | border: solid 1px black; 65 | border-radius: 3px; 66 | padding-left: 5px; 67 | cursor: pointer; 68 | } 69 | iframe { 70 | height: 90%; 71 | width: 100%; 72 | } 73 | -------------------------------------------------------------------------------- /RFEM/Reports/partsList.py: -------------------------------------------------------------------------------- 1 | 2 | from RFEM.initModel import Model 3 | 4 | def GetPartsListAllByMaterial(model = Model): 5 | ''' 6 | Returns Parts List All By Material 7 | ''' 8 | try: 9 | return model.clientModel.service.get_parts_list_all_by_material() 10 | except: 11 | model.clientModel.service.generate_parts_lists() 12 | return model.clientModel.service.get_parts_list_all_by_material() 13 | 14 | def GetPartsListMemberRepresentativesByMaterial(model = Model): 15 | ''' 16 | Returns Parts List Member Representatives By Material 17 | ''' 18 | try: 19 | return model.clientModel.service.get_parts_list_member_representatives_by_material() 20 | except: 21 | model.clientModel.service.generate_parts_lists() 22 | return model.clientModel.service.get_parts_list_member_representatives_by_material() 23 | 24 | def GetPartsListMemberSetsByMaterial(model = Model): 25 | ''' 26 | Returns Parts List Member Sets By Material 27 | ''' 28 | try: 29 | return model.clientModel.service.get_parts_list_member_sets_by_material() 30 | except: 31 | model.clientModel.service.generate_parts_lists() 32 | return model.clientModel.service.get_parts_list_member_sets_by_material() 33 | 34 | def GetPartsListMembersByMaterial(model = Model): 35 | ''' 36 | Returns Parts List Members By Material 37 | ''' 38 | try: 39 | return model.clientModel.service.get_parts_list_members_by_material() 40 | except: 41 | model.clientModel.service.generate_parts_lists() 42 | return model.clientModel.service.get_parts_list_members_by_material() 43 | 44 | def GetPartsListSolidsByMaterial(model = Model): 45 | ''' 46 | Returns Parts List Solids By Material 47 | ''' 48 | try: 49 | return model.clientModel.service.get_parts_list_solids_by_material() 50 | except: 51 | model.clientModel.service.generate_parts_lists() 52 | return model.clientModel.service.get_parts_list_solids_by_material() 53 | 54 | def GetPartsListSurfacessByMaterial(model = Model): 55 | ''' 56 | Returns Parts List Surfaces By Material 57 | ''' 58 | try: 59 | return model.clientModel.service.get_parts_list_surfaces_by_material() 60 | except: 61 | model.clientModel.service.generate_parts_lists() 62 | return model.clientModel.service.get_parts_list_surfaces_by_material() 63 | -------------------------------------------------------------------------------- /RFEM/Reports/printoutReport.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model 2 | 3 | class PrintoutReport(): 4 | """ 5 | Printout report class encopassing available printout report methods. 6 | 7 | TODO: Create printout report US is paused US-8034. 8 | """ 9 | 10 | @staticmethod 11 | def delete(id_list, model = Model): 12 | """ 13 | Delete printout report 14 | """ 15 | model.clientModel.service.delete_printout_reports(id_list) 16 | 17 | @staticmethod 18 | def exportToHTML(report_id: int, target_file_path: str, model = Model): 19 | """ 20 | Export printout report to a HTML. 21 | """ 22 | model.clientModel.service.export_printout_report_to_html(report_id, target_file_path) 23 | 24 | @staticmethod 25 | def exportToPDF(report_id: int, target_file_path: str, model = Model): 26 | """ 27 | Export printout report to a PDF. 28 | """ 29 | model.clientModel.service.export_printout_report_to_pdf(report_id, target_file_path) 30 | 31 | @staticmethod 32 | def getList(model = Model): 33 | """ 34 | Get list of printout reports. 35 | """ 36 | return model.clientModel.service.get_list_of_printout_reports()[0] 37 | 38 | @staticmethod 39 | def print(printout_report_id: int = 1, model = Model): 40 | """ 41 | Print printout report. 42 | """ 43 | model.clientModel.service.print_printout_report(printout_report_id) 44 | -------------------------------------------------------------------------------- /RFEM/Results/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/Results/designOverview.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model 2 | 3 | def GetDesignOverview(model = Model): 4 | ''' 5 | Returns whole Design Overview list. 6 | ''' 7 | # Return Design Overview 8 | return model.clientModel.service.get_design_overview() 9 | 10 | def GetPartialDesignOverview(comply: bool = False): 11 | """ 12 | Returns part of Design Overview that do(esn't) comply. 13 | If comply == False, function resturns checks with Design Ration > 1 14 | If comply == True, function resturns checks with Design Ration <= 1 15 | """ 16 | designOverview = GetDesignOverview() 17 | 18 | designRatioLessThanOne = [] 19 | designRationOverOne = [] 20 | for do in designOverview[0]: 21 | if round(do.row['design_ratio'], 5) <= 1.0: 22 | designRatioLessThanOne.append(do[0]) 23 | else: 24 | designRationOverOne.append(do[0]) 25 | 26 | if comply: 27 | return designRatioLessThanOne 28 | else: 29 | return designRationOverOne 30 | 31 | 32 | -------------------------------------------------------------------------------- /RFEM/SpecialObjects/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/SpecialObjects/enlargedColumnHead.py: -------------------------------------------------------------------------------- 1 | # TODO: only in pre-release status 2 | # 3 | #from RFEM.initModel import Model, clearAttributes 4 | # 5 | #class EnlargedColumnHead(): 6 | # def __init__(self, 7 | # no: int = 1, 8 | # comment: str = '', 9 | # params: dict = None, 10 | # model = Model): 11 | # 12 | # # Client model | Enlarged Column Head 13 | # clientObject = model.clientModel.factory.create('ns0:enlarged_column_head') 14 | # 15 | # # Clears object atributes | Sets all atributes to None 16 | # clearAttributes(clientObject) 17 | # 18 | # # Enlarged Column Head No. 19 | # clientObject.no = no 20 | # 21 | # # Comment 22 | # clientObject.comment = comment 23 | # 24 | # # Adding optional parameters via dictionary 25 | # if params: 26 | # for key in params: 27 | # clientObject[key] = params[key] 28 | # 29 | # # Delete None attributes for improved performance 30 | # deleteEmptyAttributes(clientObject) 31 | # 32 | # # Add Enlarged Column Head to client model 33 | # model.clientModel.service.set_enlarged_column_head(clientObject) 34 | -------------------------------------------------------------------------------- /RFEM/SpecialObjects/intersection.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes 2 | 3 | class Intersection(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | surface_1: int = 1, 8 | surface_2: int = 2, 9 | comment: str = '', 10 | params: dict = None, 11 | model = Model): 12 | """ 13 | Intersection 14 | 15 | Args: 16 | no (int): Intersection Tag 17 | surface_1 (int): Surface number 1 18 | surface_2 (int): Surface number 2 19 | comment (str, optional): Comment 20 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 21 | model (RFEM Class, optional): Model to be edited 22 | """ 23 | 24 | # Client model | Intersection 25 | clientObject = model.clientModel.factory.create('ns0:intersection') 26 | 27 | # Clears object atributes | Sets all atributes to None 28 | clearAttributes(clientObject) 29 | 30 | # Intersection No. 31 | clientObject.no = no 32 | 33 | # Assigned surfaces 34 | clientObject.surface_a = surface_1 35 | clientObject.surface_b = surface_2 36 | 37 | # Comment 38 | clientObject.comment = comment 39 | 40 | # Adding optional parameters via dictionary 41 | if params: 42 | for key in params: 43 | clientObject[key] = params[key] 44 | 45 | # Delete None attributes for improved performance 46 | deleteEmptyAttributes(clientObject) 47 | 48 | # Add Intersection to client model 49 | model.clientModel.service.set_intersection(clientObject) 50 | -------------------------------------------------------------------------------- /RFEM/SpecialObjects/surfaceContact.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class SurfaceContact(): 4 | def __init__(self, 5 | no: int = 1, 6 | surfaces_contact_type: int = 1, 7 | surfaces_group_1: str = '1', 8 | surfaces_group_2: str = '2', 9 | comment: str = '', 10 | params: dict = None, 11 | model = Model): 12 | """ 13 | Surface Contact 14 | 15 | Args: 16 | no (int, optional): Surface Conatct Tag 17 | surfaces_contact_type (int, optional): Surface Contact Type Number 18 | surface_group_1 (str, optional): Surfaces Group 1 19 | surface_group_2 (str, optional): Surfaces Group 2 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client model | Surfaces Contact 26 | clientObject = model.clientModel.factory.create('ns0:surfaces_contact') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # Surfaces Contact No. 32 | clientObject.no = no 33 | 34 | # Surface Contact Type 35 | clientObject.surfaces_contact_type = surfaces_contact_type 36 | 37 | # Surface Numbers 38 | clientObject.surfaces_group1 = ConvertToDlString(surfaces_group_1) 39 | clientObject.surfaces_group2 = ConvertToDlString(surfaces_group_2) 40 | 41 | # Comment 42 | clientObject.comment = comment 43 | 44 | # Adding optional parameters via dictionary 45 | if params: 46 | for key in params: 47 | clientObject[key] = params[key] 48 | 49 | # Delete None attributes for improved performance 50 | deleteEmptyAttributes(clientObject) 51 | 52 | # Add Surfaces Contact to client model 53 | model.clientModel.service.set_surfaces_contact(clientObject) 54 | -------------------------------------------------------------------------------- /RFEM/SteelDesign/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/RFEM/SteelDesign/__init__.py -------------------------------------------------------------------------------- /RFEM/SteelDesign/steelServiceabilityConfiguration.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class SteelDesignServiceabilityConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'SLS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Steel Design Serviceability Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Steel Design Serviceability Configurations 26 | clientObject = model.clientModel.factory.create('ns0:steel_design_sls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # ULS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Global Parameters to Client Model 67 | model.clientModel.service.set_steel_design_sls_configuration(clientObject) 68 | -------------------------------------------------------------------------------- /RFEM/SteelDesign/steelUltimateConfigurations.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class SteelDesignUltimateConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'ULS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Steel Design Ultimate Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Steel Design Ultimate Configurations 26 | clientObject = model.clientModel.factory.create('ns0:steel_design_uls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # ULS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Global Parameters to Client Model 67 | model.clientModel.service.set_steel_design_uls_configuration(clientObject) 68 | 69 | -------------------------------------------------------------------------------- /RFEM/TimberDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TimberDesign/timberFireConfiguration.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class TimberDesignFireConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'SLS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Timber Design Fire Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Timber Design Fire Configurations 26 | clientObject = model.clientModel.factory.create('ns0:timber_design_fr_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # FR Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Global Parameters to Client Model 67 | model.clientModel.service.set_timber_design_fr_configuration(clientObject) 68 | -------------------------------------------------------------------------------- /RFEM/TimberDesign/timberServiceLimitStateConfigurations.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class TimberDesignServiceLimitStateConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'SLS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Timber Design Service Limit State Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Timber Design Service Limit State Configurations 26 | clientObject = model.clientModel.factory.create('ns0:timber_design_sls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # SLS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Global Parameters to Client Model 67 | model.clientModel.service.set_timber_design_sls_configuration(clientObject) 68 | -------------------------------------------------------------------------------- /RFEM/TimberDesign/timberUltimateConfigurations.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class TimberDesignUltimateConfigurations(): 4 | 5 | def __init__(self, 6 | no: int = 1, 7 | name: str = 'ULS1', 8 | members_no: str = 'All', 9 | member_sets_no: str = 'All', 10 | comment: str = '', 11 | params: dict = None, 12 | model = Model): 13 | 14 | """ 15 | Args: 16 | no (int): Timber Design Ultimate Configuration Tag 17 | name (str): User Defined Configuration Name 18 | members_no (str): Assign Configuration to Selected Members 19 | member_sets_no (str): Assign Configuration to Selected Member Sets 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client Model | Timber Design Ultimate Configurations 26 | clientObject = model.clientModel.factory.create('ns0:timber_design_uls_configuration') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # ULS Configuration No. 32 | clientObject.no = no 33 | 34 | # User Defined Name 35 | if name: 36 | clientObject.user_defined_name_enabled = True 37 | clientObject.name = name 38 | 39 | # Assigned Members 40 | if members_no == 'All': 41 | clientObject.assigned_to_all_members = True 42 | 43 | else: 44 | clientObject.assigned_to_all_members = False 45 | clientObject.assigned_to_members = ConvertToDlString(members_no) 46 | 47 | # Assigned Member Sets 48 | if member_sets_no == 'All': 49 | clientObject.assigned_to_all_member_sets = True 50 | 51 | else: 52 | clientObject.assigned_to_all_member_sets = False 53 | clientObject.assigned_to_member_sets = ConvertToDlString(member_sets_no) 54 | 55 | # Comment 56 | clientObject.comment = comment 57 | 58 | # Adding optional parameters via dictionary 59 | if params: 60 | for key in params: 61 | clientObject[key] = params[key] 62 | 63 | # Delete None attributes for improved performance 64 | deleteEmptyAttributes(clientObject) 65 | 66 | # Add Global Parameters to Client Model 67 | model.clientModel.service.set_timber_design_uls_configuration(clientObject) 68 | -------------------------------------------------------------------------------- /RFEM/Tools/PlausibilityCheck.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import enum 3 | from RFEM.initModel import Model 4 | from RFEM.enums import PlausibilityCheckType 5 | 6 | class PlausibilityCheck(): 7 | 8 | def __init__(self, 9 | plausibility_check_type:enum = PlausibilityCheckType.PLAUSIBILITY_CHECK, 10 | skip_warnings:bool = False, 11 | model = Model): 12 | 13 | response = model.clientModel.service.plausibility_check(plausibility_check_type.name, skip_warnings) 14 | 15 | if response["errors_and_warnings"] and response["errors_and_warnings"][0] and not skip_warnings: 16 | errormessage = '' 17 | for item in response["errors_and_warnings"][0]: 18 | errors_and_warnings = '' 19 | if item.message_type == "ERROR": 20 | errors_and_warnings = "".join([item.message_type, '!\nObject: ', item.input_field,", ", item.object,", current value: ", item.current_value,", message: ", item.message]) 21 | elif item.message_type == "WARNING": 22 | errors_and_warnings = "".join([item.message_type, '!\n', item.message]) 23 | errormessage += '\n'+errors_and_warnings.replace('
','\n') 24 | 25 | sys.exit(errormessage) 26 | -------------------------------------------------------------------------------- /RFEM/Tools/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForAluminumDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForLines/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForLines/lineHinge.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes 2 | from RFEM.dataTypes import inf 3 | 4 | class LineHinge(): 5 | # Slab Wall Connection definition 6 | slabWallConnection = {'slab_wall_connection': True, 7 | 'slab_wall_with_slab_edge_block': True, 8 | 'slab_wall_connection_offset': 0.15, 9 | 'slab_edge_block_width':0.1} 10 | 11 | def __init__(self, 12 | no: int = 1, 13 | assigned_to: str = '3/5; 2/5', # 1/1,3; 2/6 14 | translational_release: list = [800, inf, inf], 15 | rotational_release_phi: int = inf, 16 | comment: str = '', 17 | params: dict = None, 18 | model = Model): 19 | 20 | """ 21 | Args: 22 | no (int): Line Hinge Tag 23 | assigned_to (str): Assigned to, format: 1/1,3; 2/6 24 | translational_release (list): Translation Release List 25 | rotational_release_phi (int): Rotational Release phi 26 | comment (str, optional): Comments 27 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 28 | model (RFEM Class, optional): Model to be edited 29 | """ 30 | 31 | # Client model | Line Hinge 32 | clientObject = model.clientModel.factory.create('ns0:line_hinge') 33 | 34 | # Clears object atributes | Sets all atributes to None 35 | clearAttributes(clientObject) 36 | 37 | # Line Hinge No. 38 | clientObject.no = no 39 | 40 | # Assigned to surface and its line (format 1/1,3; 2/6) 41 | clientObject.assigned_to = assigned_to 42 | 43 | # Translatioonal and totational release 44 | clientObject.translational_release_u_x = translational_release[0] 45 | clientObject.translational_release_u_y = translational_release[1] 46 | clientObject.translational_release_u_z = translational_release[2] 47 | clientObject.rotational_release_phi_x = rotational_release_phi 48 | 49 | # Slab connection 50 | clientObject.slab_wall_connection = False 51 | 52 | # Comment 53 | clientObject.comment = comment 54 | 55 | # Adding optional parameters via dictionary 56 | if params: 57 | for key in params: 58 | clientObject[key] = params[key] 59 | 60 | # Delete None attributes for improved performance 61 | deleteEmptyAttributes(clientObject) 62 | 63 | # Add Line Hinge to client model 64 | model.clientModel.service.set_line_hinge(clientObject) 65 | 66 | -------------------------------------------------------------------------------- /RFEM/TypesForMembers/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForNodes/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForSolids/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForSolids/solidGas.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes 2 | 3 | class SolidGas(): 4 | def __init__(self, 5 | no: int = 1, 6 | pressure: float = 100000, 7 | temperature: float = 283.15, 8 | solids: str = '', 9 | comment: str = '', 10 | params: dict = None, 11 | model = Model): 12 | """ 13 | Gas Solids 14 | 15 | Args: 16 | no (int): Solid Contact Tag 17 | pressure (float): Preassure in Pascals 18 | temperature (float): Temperature in Kelvins 19 | solids (str): Assigned to solids 20 | comment (str, optional): Comment 21 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 22 | model (RFEM Class, optional): Model to be edited 23 | """ 24 | 25 | # Client model | Solid Gas 26 | clientObject = model.clientModel.factory.create('ns0:solid_gas') 27 | 28 | # Clears object atributes | Sets all atributes to None 29 | clearAttributes(clientObject) 30 | 31 | # Solid Gas No. 32 | clientObject.no = no 33 | 34 | # Solid Gas Pressure 35 | clientObject.pressure = pressure 36 | 37 | # Solid Gas Temperature 38 | clientObject.temperature = temperature 39 | 40 | # Assigned to Solids 41 | clientObject.solids = solids 42 | 43 | # Comment 44 | clientObject.comment = comment 45 | 46 | # Adding optional parameters via dictionary 47 | if params: 48 | for key in params: 49 | clientObject[key] = params[key] 50 | 51 | # Delete None attributes for improved performance 52 | deleteEmptyAttributes(clientObject) 53 | 54 | # Add Solid Gas to client model 55 | model.clientModel.service.set_solid_gas(clientObject) 56 | -------------------------------------------------------------------------------- /RFEM/TypesForSolids/solidMeshRefinement.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes 2 | 3 | class SolidMeshRefinement(): 4 | def __init__(self, 5 | no: int = 1, 6 | target_length: float = 0.15, 7 | solids: str = '', 8 | comment: str = '', 9 | params: dict = None, 10 | model = Model): 11 | """ 12 | Solids Mesh Refinemet 13 | 14 | Args: 15 | no (int): Solid Contact Tag 16 | target_length (float): Target FE Length 17 | solids (str): Assigned to solids 18 | comment (str, optional): Comment 19 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 20 | model (RFEM Class, optional): Model to be edited 21 | """ 22 | 23 | # Client model | Solid Mesh Refinement 24 | clientObject = model.clientModel.factory.create('ns0:solid_mesh_refinement') 25 | 26 | # Clears object atributes | Sets all atributes to None 27 | clearAttributes(clientObject) 28 | 29 | # Solid Mesh Refinement No. 30 | clientObject.no = no 31 | 32 | # Target FE length 33 | clientObject.target_length = target_length 34 | 35 | # Assigned to solids 36 | clientObject.solids = solids 37 | 38 | # Comment 39 | clientObject.comment = comment 40 | 41 | # Adding optional parameters via dictionary 42 | if params: 43 | for key in params: 44 | clientObject[key] = params[key] 45 | 46 | # Delete None attributes for improved performance 47 | deleteEmptyAttributes(clientObject) 48 | 49 | # Add Solid Mesh Refinement to client model 50 | model.clientModel.service.set_solid_mesh_refinement(clientObject) 51 | -------------------------------------------------------------------------------- /RFEM/TypesForSpecialObjects/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForSteelDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForSurfaces/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/TypesForSurfaces/surfaceMeshRefinements.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, clearAttributes, deleteEmptyAttributes, ConvertToDlString 2 | 3 | class SurfaceMeshRefinement(): 4 | def __init__(self, 5 | no: int = 1, 6 | surfaces: str = "1", 7 | target_length: float = 0.2, 8 | comment: str = '', 9 | params: dict = None, 10 | model = Model): 11 | """ 12 | Surface Mesh Refinement 13 | 14 | Args: 15 | no (int): Surface Mesh Refinement Tag 16 | surfaces (str): Assigned to Surfaces 17 | target_length (float): Target FE Length 18 | comment (str, optional): Comment 19 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 20 | model (RFEM Class, optional): Model to be edited 21 | """ 22 | 23 | # Client model | Surface Mesh Refinement 24 | clientObject = model.clientModel.factory.create('ns0:surface_mesh_refinement') 25 | 26 | # Clears object atributes | Sets all atributes to None 27 | clearAttributes(clientObject) 28 | 29 | # Surface Mesh Refinement No. 30 | clientObject.no = no 31 | 32 | # Assigned to Surfaces 33 | clientObject.surfaces = ConvertToDlString(surfaces) 34 | 35 | # Target FE Length 36 | clientObject.target_length = target_length 37 | 38 | # Comment 39 | clientObject.comment = comment 40 | 41 | # Adding optional parameters via dictionary 42 | if params: 43 | for key in params: 44 | clientObject[key] = params[key] 45 | 46 | # Delete None attributes for improved performance 47 | deleteEmptyAttributes(clientObject) 48 | 49 | # Add Surface Mesh Refinement to client model 50 | model.clientModel.service.set_surface_mesh_refinement(clientObject) 51 | -------------------------------------------------------------------------------- /RFEM/TypesForSurfaces/surfaceSupport.py: -------------------------------------------------------------------------------- 1 | from RFEM.initModel import Model, ConvertToDlString, clearAttributes, deleteEmptyAttributes 2 | from RFEM.dataTypes import inf 3 | 4 | class SurfaceSupport(): 5 | def __init__(self, 6 | no: int = 1, 7 | surfaces_no: str = '1', 8 | c_ux: float = 10000.0, 9 | c_uy: float = 0.0, 10 | c_uz: float = inf, 11 | c_vxz: float = inf, 12 | c_vyz: float = inf, 13 | comment: str = '', 14 | params: dict = None, 15 | model = Model): 16 | """ 17 | Surface Support 18 | 19 | Args: 20 | no (int): Surface Support Tag 21 | surfaces_no (str): Assigned to Surfaces 22 | c_ux (float): Translational Support in X direction 23 | c_uy (float): Translational Support in Y direction 24 | c_uz (float): Translational Support in Z direction 25 | c_vxz (float): Shear Support in XZ direction 26 | c_vyz (float): Shear Support in YZ direction 27 | comment (str, optional): Comment 28 | params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary 29 | model (RFEM Class, optional): Model to be edited 30 | """ 31 | 32 | # Client model | Surface Support 33 | clientObject = model.clientModel.factory.create('ns0:surface_support') 34 | 35 | # Clears object atributes | Sets all atributes to None 36 | clearAttributes(clientObject) 37 | 38 | # Surface Support No. 39 | clientObject.no = no 40 | 41 | # Surface No. (e.g. "5 6 7 12") 42 | clientObject.surfaces = ConvertToDlString(surfaces_no) 43 | 44 | # Surface Support Conditions 45 | clientObject.translation_x = c_ux 46 | clientObject.translation_y = c_uy 47 | clientObject.translation_z = c_uz 48 | clientObject.shear_xz = c_vxz 49 | clientObject.shear_yz = c_vyz 50 | 51 | # Comment 52 | clientObject.comment = comment 53 | 54 | # Adding optional parameters via dictionary 55 | if params: 56 | for key in params: 57 | clientObject[key] = params[key] 58 | 59 | # Delete None attributes for improved performance 60 | deleteEmptyAttributes(clientObject) 61 | 62 | # Add Surface Support to client model 63 | model.clientModel.service.set_surface_support(clientObject) 64 | -------------------------------------------------------------------------------- /RFEM/TypesForTimberDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /RFEM/TypesforConcreteDesign/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /RFEM/connectionGlobals.py: -------------------------------------------------------------------------------- 1 | 2 | url = "http://127.0.0.1" 3 | port = "8081" 4 | connected = False 5 | api_key = None 6 | verify = True # This can be a boolean or a path to a CA bundle file (in case of self-signed certificate it's required) 7 | 8 | # Is filled in the initModel 9 | client = None 10 | ca = None 11 | cacheLoc = "" 12 | session = None 13 | -------------------------------------------------------------------------------- /RFEM/dataTypes.py: -------------------------------------------------------------------------------- 1 | # Specific data types 2 | 3 | inf = float('inf') 4 | nan = float('nan') 5 | -------------------------------------------------------------------------------- /RFEM/dependencies.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # Check Python version 4 | if not sys.version_info[0] == 3: 5 | print('Must be using Python 3!') 6 | input('Press Enter to exit...') 7 | sys.exit() 8 | 9 | # Check all dependencies 10 | try: 11 | import requests 12 | import six 13 | import xmltodict 14 | import pytest 15 | import mock 16 | import suds.transport 17 | import suds.client # suds-py3 18 | 19 | except: 20 | print('One of the required modules is not installed in your Python env.') 21 | instSUDS = input('\nDo you want to install all dependencies and check all their versions (y/n)? ') 22 | instSUDS = instSUDS.lower() 23 | if instSUDS == 'y': 24 | # Subprocess will be opened in cmd and closed automaticaly after installation. Only needed packages 25 | # Prevents invoking pip by an old script wrapper (https://github.com/pypa/pip/issues/5599) 26 | import os 27 | import subprocess 28 | try: 29 | subprocess.call('python -m pip install --upgrade pip') 30 | subprocess.call('python -m pip install requests six suds-py3 xmltodict pytest mock --user') 31 | os.execv(sys.executable, ['python'] + sys.argv) 32 | except: 33 | print('WARNING: Installation of modules failed!') 34 | print('Please use command "python -m pip install requests six suds-py3 xmltodict pytest mock --user" in your Command Prompt.') 35 | input('Press Enter to exit...') 36 | sys.exit() 37 | else: 38 | input('Press Enter to exit...') 39 | sys.exit() -------------------------------------------------------------------------------- /UnitTests/Examples.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import subprocess 4 | from fnmatch import fnmatch 5 | PROJECT_ROOT = os.path.abspath(os.path.join( 6 | os.path.dirname(__file__), 7 | os.pardir) 8 | ) 9 | sys.path.append(PROJECT_ROOT) 10 | 11 | root = PROJECT_ROOT+"\\Examples" 12 | pattern = "*.py" 13 | 14 | def test_examples(): 15 | """ 16 | Run this function in order to execute all *.py files in Examples folder. 17 | This routine is exempt from standard pytest collection because it requires manual input. 18 | 19 | When executing in cmd always use verbose (-s) to run scripts without GUI. 20 | Example: 21 | pytest -s ./RFEM_Python_Client/UnitTests/Examples.py 22 | """ 23 | print() # jump 1 line further 24 | 25 | for path, subdirs, files in os.walk(root): 26 | for name in files: 27 | if fnmatch(name, pattern) and name != "__init__.py": 28 | example = os.path.join(path, name) 29 | process = subprocess.Popen('python '+example, shell=True) # shell=True has to be there 30 | process.wait() 31 | -------------------------------------------------------------------------------- /UnitTests/conftest.py: -------------------------------------------------------------------------------- 1 | # Pytest fixtures 2 | import os 3 | import sys 4 | 5 | PROJECT_ROOT = os.path.abspath(os.path.join( 6 | os.path.dirname(__file__), 7 | os.pardir) 8 | ) 9 | sys.path.append(PROJECT_ROOT) 10 | from RFEM.initModel import Model, closeAllModels 11 | from RFEM.connectionGlobals import cacheLoc 12 | 13 | def pytest_exception_interact(): 14 | ''' 15 | Called when an exception is raised which can potentially be interactively handled, 16 | in our case after the failed test. 17 | ''' 18 | 19 | # This ensures that the tests executed after failed test are not affected. 20 | if Model.clientModel: 21 | closeAllModels() 22 | if os.path.exists(cacheLoc): 23 | for file in os.listdir(cacheLoc): 24 | filePath = os.path.join(cacheLoc, file) 25 | os.remove(filePath) 26 | Model() 27 | 28 | -------------------------------------------------------------------------------- /UnitTests/src/import_test_saf.saf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/import_test_saf.saf -------------------------------------------------------------------------------- /UnitTests/src/import_test_xlsx.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/import_test_xlsx.xlsx -------------------------------------------------------------------------------- /UnitTests/src/printout.rf6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/printout.rf6 -------------------------------------------------------------------------------- /UnitTests/src/rsection_test.rsc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/rsection_test.rsc -------------------------------------------------------------------------------- /UnitTests/src/timberMoistureClass.rf6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/timberMoistureClass.rf6 -------------------------------------------------------------------------------- /UnitTests/src/timberServiceConditionCSA.rf6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/timberServiceConditionCSA.rf6 -------------------------------------------------------------------------------- /UnitTests/src/timberServiceConditionGB.rf6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/timberServiceConditionGB.rf6 -------------------------------------------------------------------------------- /UnitTests/src/timberServiceConditionNDS.rf6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/UnitTests/src/timberServiceConditionNDS.rf6 -------------------------------------------------------------------------------- /UnitTests/test_Action.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import NodalSupportType, AddOn, ActionCategoryType, ActionType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.line import Line 13 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 14 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 15 | from RFEM.LoadCasesAndCombinations.loadCase import LoadCase 16 | from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations 17 | from RFEM.LoadCasesAndCombinations.action import Action 18 | 19 | if Model.clientModel is None: 20 | Model() 21 | 22 | def test_action(): 23 | 24 | Model.clientModel.service.delete_all() 25 | Model.clientModel.service.begin_modification() 26 | 27 | SetAddonStatus(Model.clientModel, addOn = AddOn.structure_stability_active, status = True) 28 | 29 | Node(1, 0.0, 0.0, 0.0) 30 | Node(2, 5, 0.0, 0.0) 31 | Line(1, '1 2') 32 | NodalSupport(1, '1', NodalSupportType.FIXED) 33 | 34 | StaticAnalysisSettings.GeometricallyLinear(1, "Linear") 35 | LoadCasesAndCombinations({ 36 | "current_standard_for_combination_wizard": 6207, 37 | "activate_combination_wizard_and_classification": True, 38 | "activate_combination_wizard": True, 39 | "result_combinations_active": False, 40 | "result_combinations_parentheses_active": False, 41 | "result_combinations_consider_sub_results": False, 42 | "combination_name_according_to_action_category": False 43 | }, 44 | model= Model) 45 | 46 | LoadCase(1, 'Self-Weight', [True, 0.0, 0.0,1.0]) 47 | 48 | Action(1, ActionCategoryType.ACTION_CATEGORY_PERMANENT_G, ActionType.ACTING_DIFFERENTLY, [[1,1]]) 49 | 50 | Model.clientModel.service.finish_modification() 51 | 52 | action = Model.clientModel.service.get_action(1) 53 | assert action.action_category == ActionCategoryType.ACTION_CATEGORY_PERMANENT_G.name 54 | assert action.action_type == ActionType.ACTING_DIFFERENTLY.name 55 | -------------------------------------------------------------------------------- /UnitTests/test_BaseSettings_test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.enums import GlobalAxesOrientationType, LocalAxesOrientationType 9 | from RFEM.baseSettings import BaseSettings 10 | from RFEM.initModel import Model 11 | 12 | if Model.clientModel is None: 13 | Model() 14 | 15 | def test_baseSettings(): 16 | Model.clientModel.service.delete_all() 17 | Model.clientModel.service.begin_modification() 18 | 19 | # Set Base Settings 20 | BaseSettings(12, GlobalAxesOrientationType.E_GLOBAL_AXES_ORIENTATION_ZUP, LocalAxesOrientationType.E_LOCAL_AXES_ORIENTATION_ZUP, [0.001, 0.002, 0.003, 0.004]) 21 | 22 | Model.clientModel.service.finish_modification() 23 | 24 | msao = Model.clientModel.service.get_model_settings_and_options() 25 | assert msao.gravitational_acceleration == 12 26 | assert msao.global_axes_orientation == 'E_GLOBAL_AXES_ORIENTATION_ZUP' 27 | assert msao.local_axes_orientation == 'E_LOCAL_AXES_ORIENTATION_ZUP' 28 | assert msao.tolerance_for_nodes == 0.001 29 | assert msao.tolerance_for_lines == 0.002 30 | assert msao.tolerance_for_surfaces_and_planes == 0.003 31 | assert msao.tolerance_for_directions == 0.004 32 | -------------------------------------------------------------------------------- /UnitTests/test_DesignOverview.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import pytest 4 | PROJECT_ROOT = os.path.abspath(os.path.join( 5 | os.path.dirname(__file__), 6 | os.pardir) 7 | ) 8 | sys.path.append(PROJECT_ROOT) 9 | 10 | from RFEM.enums import AddOn 11 | from RFEM.initModel import Model, SetAddonStatus 12 | from RFEM.connectionGlobals import url 13 | from RFEM.Results.designOverview import GetDesignOverview, GetPartialDesignOverview 14 | from RFEM.Reports.partsList import GetPartsListAllByMaterial, GetPartsListMemberRepresentativesByMaterial 15 | from RFEM.Reports.partsList import GetPartsListMemberSetsByMaterial, GetPartsListMembersByMaterial 16 | from RFEM.Reports.partsList import GetPartsListSolidsByMaterial, GetPartsListSurfacessByMaterial 17 | from tools import getPathToRunningRFEM 18 | 19 | if Model.clientModel is None: 20 | Model() 21 | 22 | @pytest.mark.skipif(url != 'http://127.0.0.1', reason="This test fails on remote PC due to incorrect file path. \ 23 | Althought it is easy to change, it would not be easy to update on every remote computer.\ 24 | It is not necessary to evaluate Client as functional. Localy this tests still gets executed.") 25 | 26 | def test_designOverview(): 27 | 28 | Model.clientModel.service.delete_all() 29 | Model.clientModel.service.run_script(os.path.join(getPathToRunningRFEM(),'scripts\\internal\\Demos\\Demo-004 Bus Station-Concrete Design.js')) 30 | SetAddonStatus(Model.clientModel, AddOn.concrete_design_active) 31 | Model.clientModel.service.calculate_all(False) 32 | 33 | designOverview = GetDesignOverview() 34 | assert round(designOverview[0][0].row['design_ratio']) == 3 35 | assert designOverview[0][0].row['design_check_type'] == 'DM0210.00' 36 | 37 | partialDesignOverview = GetPartialDesignOverview(False) 38 | assert len(partialDesignOverview) > 1 39 | 40 | partialDesignOverview = GetPartialDesignOverview(True) 41 | assert len(partialDesignOverview) > 1 42 | 43 | a = GetPartsListAllByMaterial() 44 | assert len(a[0]) == 5 45 | assert a[0][0].row['volume'] == a[0][1].row['volume'] 46 | 47 | b = GetPartsListMemberRepresentativesByMaterial() 48 | assert b == '' 49 | 50 | c = GetPartsListMemberSetsByMaterial() 51 | assert c == '' 52 | 53 | d = GetPartsListMembersByMaterial() 54 | assert len(d[0][0].row) == 13 55 | assert d[0][0].row['members_no'] == '1' 56 | 57 | e = GetPartsListSolidsByMaterial() 58 | assert e == '' 59 | 60 | f = GetPartsListSurfacessByMaterial() 61 | assert len(f[0][0].row) == 13 62 | assert 'Uniform | d : 120.0 mm | 2 - C20/25' in f[0][0].row['thickness_name'] 63 | -------------------------------------------------------------------------------- /UnitTests/test_GetAllObjects.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.initModel import Model 9 | from RFEM.connectionGlobals import url 10 | from RFEM.Tools.GetObjectNumbersByType import GetAllObjects 11 | import pytest 12 | from tools import getPathToRunningRFEM 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | @pytest.mark.skipif(url != 'http://127.0.0.1', reason="This test fails on remote PC due to incorrect file path. \ 18 | Althought it is easy to change, it would not be easy to update on every remote computer.\ 19 | It is not necessary to evaluate Client as functional. Localy this tests still gets executed.") 20 | def test_GetAllObjects(): 21 | 22 | Model.clientModel.service.delete_all() 23 | Model.clientModel.service.run_script(os.path.join(getPathToRunningRFEM(),'scripts\\internal\\Demos\\Demo-002 Cantilever Beams.js')) 24 | 25 | objects, imports = GetAllObjects() 26 | 27 | assert len(imports) > 18 28 | assert len(objects) > 160 29 | -------------------------------------------------------------------------------- /UnitTests/test_GetObjectNumbersByType.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.enums import ObjectTypes 9 | from RFEM.initModel import Model 10 | from RFEM.BasicObjects.node import Node 11 | from RFEM.BasicObjects.line import Line 12 | from RFEM.BasicObjects.lineSet import LineSet 13 | from RFEM.Tools.GetObjectNumbersByType import GetObjectNumbersByType 14 | 15 | if Model.clientModel is None: 16 | Model() 17 | 18 | def test_GetObjectNumbersByType(): 19 | 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | Node(1, 0, 0, 0) 24 | Node(2, 5, 0, 0) 25 | Node(3, 0, 5, 0) 26 | 27 | Line(1, '1 2') 28 | Line(2, '2 3') 29 | LineSet(1, '1 2') 30 | 31 | Model.clientModel.service.finish_modification() 32 | 33 | ObjectDictionary = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_LINE) 34 | assert ObjectDictionary == [1, 2] 35 | 36 | ObjectDictionary = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_NODE) 37 | assert ObjectDictionary == [1, 2, 3] 38 | 39 | ObjectDictionary = GetObjectNumbersByType(ObjectTypes.E_OBJECT_TYPE_LINE_SET) 40 | assert ObjectDictionary == [1] 41 | -------------------------------------------------------------------------------- /UnitTests/test_LineSupports.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.dataTypes import inf 10 | from RFEM.initModel import Model 11 | from RFEM.enums import LineSupportType 12 | from RFEM.BasicObjects.node import Node 13 | from RFEM.BasicObjects.line import Line 14 | from RFEM.TypesForLines.lineSupport import LineSupport 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | def test_LineSupports(): 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | Node(1, 0.0, 0.0, 0.0) 24 | Node(2, 5.0, 0.0, 0.0) 25 | Node(3, 10.0, 0.0, 0.0) 26 | Node(4, 15.0, 0.0, 0.0) 27 | Node(5, 20.0, 0.0, 0.0) 28 | 29 | Line(1, '1 2') 30 | Line(2, '2 3') 31 | Line(3, '3 4') 32 | Line(4, '4 5') 33 | 34 | LineSupport(1, '1', [0, inf, 15000, inf, inf, inf]) 35 | LineSupport(2, '2', LineSupportType.FIXED) 36 | LineSupport(3, '3', LineSupportType.HINGED) 37 | LineSupport(4, '4', LineSupportType.FREE) 38 | 39 | Model.clientModel.service.finish_modification() 40 | 41 | ls1 = Model.clientModel.service.get_line_support(1) 42 | assert ls1.spring.z == 15000.0 43 | assert ls1.rotational_restraint.z == inf 44 | 45 | ls2 = Model.clientModel.service.get_line_support(2) 46 | assert ls2.spring.x == inf 47 | assert ls2.spring.y == inf 48 | assert ls2.spring.z == inf 49 | assert ls2.rotational_restraint.x == inf 50 | assert ls2.rotational_restraint.y == inf 51 | assert ls2.rotational_restraint.z == inf 52 | 53 | ls3 = Model.clientModel.service.get_line_support(3) 54 | assert ls3.spring.x == inf 55 | assert ls3.spring.y == inf 56 | assert ls3.spring.z == inf 57 | assert ls3.rotational_restraint.x == 0.0 58 | assert ls3.rotational_restraint.y == 0.0 59 | assert ls3.rotational_restraint.z == 0.0 60 | 61 | ls4 = Model.clientModel.service.get_line_support(4) 62 | assert ls4.spring.x == 10000.0 63 | assert ls4.spring.y == 0.0 64 | assert ls4.spring.z == 0.0 65 | assert ls4.rotational_restraint.x == 0.0 66 | assert ls4.rotational_restraint.y == 0.0 67 | assert ls4.rotational_restraint.z == 0.0 68 | -------------------------------------------------------------------------------- /UnitTests/test_LoadCases_Test.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.Imperfections.imperfectionCase import ImperfectionCase 11 | from RFEM.SpecialObjects.structureModification import StructureModification 12 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 13 | from RFEM.LoadCasesAndCombinations.loadCase import LoadCase 14 | from RFEM.enums import ActionCategoryType 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | def test_load_case(): 20 | 21 | Model.clientModel.service.delete_all() 22 | Model.clientModel.service.begin_modification() 23 | 24 | StaticAnalysisSettings() 25 | ImperfectionCase(1) 26 | ImperfectionCase(2) 27 | StructureModification(1) 28 | LoadCase.StaticAnalysis(1, 'SW', True, 1, ActionCategoryType.ACTION_CATEGORY_PERMANENT_G, [True, 0, 0, 1], 2) 29 | LoadCase.StaticAnalysis(2, 'SDL', True, 1, ActionCategoryType.ACTION_CATEGORY_PERMANENT_IMPOSED_GQ, [True, 0.1, 0.1, 0], 1, 1) 30 | LoadCase.StaticAnalysis(3, 'Snow', True, 1, ActionCategoryType.ACTION_CATEGORY_SNOW_ICE_LOADS_H_LESS_OR_EQUAL_TO_1000_M_QS, [False]) 31 | LoadCase.StaticAnalysis(4, 'Wind', False, 1, ActionCategoryType.ACTION_CATEGORY_WIND_QW, [False]) 32 | 33 | Model.clientModel.service.finish_modification() 34 | 35 | lc_1 = Model.clientModel.service.get_load_case(1) 36 | assert lc_1.to_solve == True 37 | assert lc_1.action_category == 'ACTION_CATEGORY_PERMANENT_G' 38 | assert lc_1.self_weight_active == True 39 | assert lc_1.self_weight_factor_x == 0 40 | assert lc_1.self_weight_factor_z == 1 41 | assert lc_1.imperfection_case == 2 42 | assert lc_1.structure_modification_enabled == False 43 | 44 | lc_2 = Model.clientModel.service.get_load_case(2) 45 | assert lc_2.action_category == 'ACTION_CATEGORY_PERMANENT_IMPOSED_GQ' 46 | assert lc_2.self_weight_factor_x == 0.1 47 | assert lc_2.self_weight_factor_z == 0 48 | assert lc_2.imperfection_case == 1 49 | assert lc_2.structure_modification == 1 50 | 51 | lc_3 = Model.clientModel.service.get_load_case(3) 52 | assert lc_3.action_category == 'ACTION_CATEGORY_SNOW_ICE_LOADS_H_LESS_OR_EQUAL_TO_1000_M_QS' 53 | assert lc_3.self_weight_active == False 54 | assert lc_3.consider_imperfection == False 55 | assert lc_3.structure_modification_enabled == False 56 | 57 | assert Model.clientModel.service.get_load_case(4).self_weight_active == False 58 | -------------------------------------------------------------------------------- /UnitTests/test_MeshGenerationStatistics.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 9 | from RFEM.BasicObjects.surface import Surface 10 | from RFEM.BasicObjects.line import Line 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.thickness import Thickness 13 | from RFEM.BasicObjects.material import Material 14 | from RFEM.initModel import Model 15 | from RFEM.Calculate.meshSettings import GetMeshStatistics, GenerateMesh 16 | from RFEM.enums import * 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_generation_of_mesh_statistics(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | # Create Material 27 | Material(1, 'S235') 28 | Thickness(1, '20 mm', 1, 0.02) 29 | 30 | Node(1, 0, 0, 0) 31 | Node(2, 5, 0, 0) 32 | Node(3, 0, 5, 0) 33 | Node(4, 5, 5, 0) 34 | 35 | Line(1, '1 2') 36 | Line(2, '2 4') 37 | Line(3, '4 3') 38 | Line(4, '3 1') 39 | 40 | Surface(1, '1 2 3 4', 1) 41 | 42 | NodalSupport(1, '1 2 3 4', NodalSupportType.FIXED) 43 | 44 | GenerateMesh() 45 | 46 | Model.clientModel.service.finish_modification() 47 | 48 | mesh_stats = GetMeshStatistics() 49 | 50 | assert mesh_stats['member_1D_finite_elements'] == 0 51 | assert mesh_stats['surface_2D_finite_elements'] == 100 52 | assert mesh_stats['solid_3D_finite_elements'] == 0 53 | assert mesh_stats['node_elements'] == 121 54 | -------------------------------------------------------------------------------- /UnitTests/test_ModelCheck.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.BasicObjects.member import Member 10 | from RFEM.BasicObjects.line import Line 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.material import Material 14 | from RFEM.initModel import Model, CheckIfMethodOrTypeExists 15 | from RFEM.Tools.ModelCheck import ModelCheck 16 | import pytest 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | # TODO: US-8140 22 | @pytest.mark.skipif(CheckIfMethodOrTypeExists(Model.clientModel,'model_check__get_object_groups_operation', True), reason="model_check__get_object_groups_operation not in RFEM GM yet") 23 | def test_model_check(): 24 | 25 | Model.clientModel.service.delete_all() 26 | Model.clientModel.service.begin_modification() 27 | 28 | Material(1, 'S235') 29 | Section(1, 'IPE 300', 1) 30 | 31 | Node(1, 0, 0, 0) 32 | Node(2, 0, 0, 0) 33 | Node(3, 1, 1, 1) 34 | Node(4, 1, 1, 1) 35 | 36 | Node(5, 10, 0, 0) 37 | Node(6, 10, 3, 0) 38 | Node(7, 9, 2, 0) 39 | Node(8, 11, 2, 0) 40 | 41 | Node(9, 13, 0, 0) 42 | Node(10, 13, 3, 0) 43 | Node(11, 12, 2, 0) 44 | Node(12, 14, 2, 0) 45 | 46 | Node(13, 5, 0, 0) 47 | Node(14, 5, 3, 0) 48 | 49 | Node(15, 7, 0, 0) 50 | Node(16, 7, 3, 0) 51 | 52 | Line(1, '5 6') 53 | Line(2, '7 8') 54 | 55 | Line(3, '13 14') 56 | Line(4, '13 14') 57 | 58 | Member(1, 9, 10, 0, 1, 1) 59 | Member(2, 11, 12, 0, 1, 1) 60 | Member(3, 15, 16, 0, 1, 1) 61 | Member(4, 15, 16, 0, 1, 1) 62 | 63 | Model.clientModel.service.finish_modification() 64 | 65 | identical_nodes = ModelCheck.GetIdenticalNodes(0.0005) 66 | assert identical_nodes[0][0] == "1,2" 67 | assert identical_nodes[0][1] == "3,4" 68 | ModelCheck.DeleteUnusedNodes(0.0005, identical_nodes) 69 | connected_lines = ModelCheck.GetNotConnectedLines(0.0005) 70 | assert connected_lines[0][0] == "1,2" 71 | assert connected_lines[0][1] == "5,6" 72 | ModelCheck.CrossLines(0.0005, connected_lines) 73 | ModelCheck.GetNotConnectedMembers(0.0005) 74 | overlapping_lines = ModelCheck.GetOverlappingLines() 75 | assert overlapping_lines[0][0] == "3,4" 76 | assert overlapping_lines[0][1] == "7,8" 77 | overlapping_members = ModelCheck.GetOverlappingMembers() 78 | assert overlapping_members[0][0] == "3,4" 79 | 80 | -------------------------------------------------------------------------------- /UnitTests/test_ResponseSpectrum.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import AddOn 11 | from RFEM.DynamicLoads.responseSpectrum import ResponseSpectrum 12 | 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | def test_response_spectrum(): 18 | 19 | SetAddonStatus(Model.clientModel, AddOn.spectral_active, True) 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | # create user defined response spectrum 24 | ResponseSpectrum(2, user_defined_spectrum=[[0, 0.66], [0.15, 1.66]]) 25 | ResponseSpectrum.UserDefinedGFactor(3, 'secondSpectrum', 0.12, True, [[1, 0.5], [2, 1]]) 26 | Model.clientModel.service.finish_modification() 27 | 28 | rsp_2 = Model.clientModel.service.get_response_spectrum(2) 29 | rsp_3 = Model.clientModel.service.get_response_spectrum(3) 30 | 31 | assert rsp_2.no == 2 32 | assert rsp_3.user_defined_response_spectrum_period_step == 0.12 33 | assert round(rsp_2.user_defined_response_spectrum[0][0]['row']['acceleration'], 2) == 0.66 34 | assert round(rsp_2.user_defined_response_spectrum[0][1]['row']['period'], 2) == 0.15 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /UnitTests/test_RigidLinks.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.BasicObjects.material import Material 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.line import Line 13 | from RFEM.BasicObjects.surface import Surface 14 | from RFEM.SpecialObjects.rigidLink import RigidLink 15 | from RFEM.BasicObjects.thickness import Thickness 16 | 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_rigid_links(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | Material(1, 'S235') 27 | Thickness(1, 'Thick', 1, 0.35) 28 | 29 | Node(1, 0.1, 0, 0) 30 | Node(2, 4.9, 0, 0) 31 | Node(3, 4.9, 5, 0) 32 | Node(4, 0.1, 5, 0) 33 | 34 | Node(5, 0, 6, 0) 35 | Node(6, 0, 6, -3) 36 | Node(7, 5, 6, -3) 37 | Node(8, 5, 6, 0) 38 | Node(9, 5, 6 , 3) 39 | Node(10, 0, 6, 3) 40 | 41 | Line(1, '1 2') 42 | Line(2, '2 3') 43 | Line(3, '3 4') 44 | Line(4, '4 1') 45 | 46 | Line(5, '10 6') 47 | Line(6, '6 7') 48 | Line(7, '7 9') 49 | Line(8, '9 10') 50 | 51 | Line(9, '5 8') 52 | 53 | Surface(1, '1-4') 54 | Surface(2, '5-8') 55 | 56 | RigidLink(1, 3, 6) 57 | RigidLink.LineToLine(2, 3, 8) 58 | RigidLink.LineToSurface(3, 3, 2) 59 | RigidLink.Diapragm(4,'3 4', '6 9') 60 | 61 | Model.clientModel.service.finish_modification() 62 | 63 | rl_1 = Model.clientModel.service.get_rigid_link(1) 64 | assert rl_1.type == 'TYPE_LINE_TO_LINE' 65 | assert rl_1.line1 == 3 66 | assert rl_1.line2 == 6 67 | 68 | rl_2 = Model.clientModel.service.get_rigid_link(2) 69 | assert rl_2.type == 'TYPE_LINE_TO_LINE' 70 | assert rl_2.line1 == 3 71 | assert rl_2.line2 == 8 72 | 73 | rl_3 = Model.clientModel.service.get_rigid_link(3) 74 | assert rl_3.type == 'TYPE_LINE_TO_SURFACE' 75 | assert rl_3.line1 == 3 76 | assert rl_3.line2 == 10 77 | 78 | rl_4 = Model.clientModel.service.get_rigid_link(4) 79 | assert rl_4.type == 'TYPE_DIAPHRAGM' 80 | assert rl_4.nodes == '3 4' 81 | assert rl_4.lines == '6 9' 82 | 83 | -------------------------------------------------------------------------------- /UnitTests/test_SectionDialogue.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.connectionGlobals import url 11 | from RFEM.Tools.sectionDialogue import * 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.material import Material 14 | import pytest 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | @pytest.mark.skipif(url != 'http://127.0.0.1', reason="This test fails on remote PC due to incorrect file path. \ 20 | Althought it is easy to change, it would not be easy to update on every remote computer.\ 21 | It is not necessary to evaluate Client as functional. Localy this tests still gets executed.") 22 | def test_section_dialogue(): 23 | 24 | Model.clientModel.service.delete_all() 25 | Model.clientModel.service.begin_modification() 26 | 27 | Material() 28 | Section(1, "IPE 300") 29 | Section(2, "HEA 200") 30 | 31 | #Create a Section Favorite List 32 | CreateSectionList("Favs_1") 33 | CreateSectionList("Favs_2") 34 | 35 | #Add Section to Favorite List 36 | AddSectionToMySectionList("Favs_1", "IPE 300") 37 | AddSectionToMySectionList("Favs_1", "HEA 200") 38 | 39 | #Delete Section From Favorite List 40 | DeleteSectionFromSectionList("Favs_1", "HEA 200") 41 | 42 | #Get Section Favorite List 43 | GetMySectionLists() 44 | 45 | #Delete Section Favorite List 46 | DeleteSectionList("Favs_2") 47 | DeleteSectionList("Favs_1") 48 | 49 | #Create Section from Rsection File 50 | CreateSectionFromRsectionFile(3, os.path.dirname(__file__)+'\\src\\rsection_test.rsc') 51 | 52 | Model.clientModel.service.finish_modification() 53 | -------------------------------------------------------------------------------- /UnitTests/test_SurfaceRelease.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.dataTypes import inf 10 | from RFEM.initModel import Model 11 | from RFEM.enums import * 12 | from RFEM.BasicObjects.material import Material 13 | from RFEM.BasicObjects.section import Section 14 | from RFEM.BasicObjects.thickness import Thickness 15 | from RFEM.BasicObjects.node import Node 16 | from RFEM.BasicObjects.line import Line 17 | from RFEM.BasicObjects.member import Member 18 | from RFEM.BasicObjects.surface import Surface 19 | from RFEM.BasicObjects.solid import Solid 20 | from RFEM.TypesForSpecialObjects.surfaceReleaseType import SurfaceReleaseType 21 | from RFEM.SpecialObjects.surfaceRelease import SurfaceRelease 22 | 23 | if Model.clientModel is None: 24 | Model() 25 | 26 | def test_LineRelease(): 27 | 28 | Model.clientModel.service.delete_all() 29 | Model.clientModel.service.begin_modification() 30 | 31 | Material(1) 32 | Section(1, 'IPE 120') 33 | Thickness(1, uniform_thickness_d= 0.1) 34 | 35 | Node(1,0,0,0) 36 | Node(2,10,0,0) 37 | Node(3,10,10,0) 38 | Node(4,0,10,0) 39 | Node(5,0,0,-10) 40 | Node(6,10,0,-10) 41 | Node(7,10,10,-10) 42 | Node(8,0,10,-10) 43 | 44 | Line(1,'1 2') 45 | Line(2,'2 3') 46 | Line(3,'3 4') 47 | Line(4,'4 1') 48 | Line(5,'5 6') 49 | Line(6,'6 7') 50 | Line(7,'7 8') 51 | Line(8,'8 5') 52 | Line(9,'1 5') 53 | Line(10,'2 6') 54 | Line(11,'3 7') 55 | Line(12,'4 8') 56 | 57 | Member(1, line=1) 58 | Member(2, line=2) 59 | Member(3, line=3) 60 | Member(4, line=4) 61 | Member(5, line=5) 62 | Member(6, line=6) 63 | Member(7, line=7) 64 | Member(8, line=8) 65 | Member(9, line=9) 66 | Member(10, line=10) 67 | Member(11, line=11) 68 | Member(12, line=12) 69 | 70 | Surface(1) 71 | Surface(2, '5 6 7 8') 72 | Surface(3, '1 5 9 10') 73 | Surface(4, '2 6 10 11') 74 | Surface(5, '3 7 11 12') 75 | Surface(6, '4 8 9 12') 76 | 77 | Solid(1, '1 2 3 4 5 6') 78 | 79 | SurfaceReleaseType(1, [0.1, 0.2, inf]) 80 | SurfaceReleaseType(2, [inf, inf, inf]) 81 | 82 | SurfaceRelease(1, '2', 1, SurfaceReleaseReleaseLocation.RELEASE_LOCATION_ORIGIN, '6', '4 5', '1', '7', '5 8', name='Surface Release') 83 | 84 | Model.clientModel.service.finish_modification() 85 | 86 | sr1 = Model.clientModel.service.get_surface_release(1) 87 | 88 | assert sr1.surface_release_type == 1 89 | assert sr1.name == 'Surface Release' 90 | assert sr1.use_nodes_as_definition_nodes == '7' 91 | assert sr1.released_surfaces == '4 5' 92 | -------------------------------------------------------------------------------- /UnitTests/test_SurfaceReleaseType.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.enums import * 11 | from RFEM.dataTypes import inf 12 | from RFEM.TypesForSpecialObjects.surfaceReleaseType import SurfaceReleaseType 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | def test_SurfaceReleaseType(): 18 | 19 | Model.clientModel.service.delete_all() 20 | Model.clientModel.service.begin_modification() 21 | 22 | SurfaceReleaseType(1, [inf, 1, 0.1], SurfaceTranslationalReleaseNonlinearity.NONLINEARITY_TYPE_NONE, SurfaceTranslationalReleaseNonlinearity.NONLINEARITY_TYPE_FAILURE_IF_POSITIVE, 23 | SurfaceTranslationalReleaseNonlinearity.NONLINEARITY_TYPE_FAILURE_IF_NEGATIVE, SurfaceReleaseTypeLocalAxisSystemType.LOCAL_AXIS_SYSTEM_TYPE_SAME_AS_ORIGINAL_SURFACE, 24 | name = 'Surface Release') 25 | 26 | Model.clientModel.service.finish_modification() 27 | 28 | sr = Model.clientModel.service.get_surface_release_type(1) 29 | 30 | assert sr.translational_release_u_y == 1 31 | assert sr.name == 'Surface Release' 32 | -------------------------------------------------------------------------------- /UnitTests/test_aluminumDesignSLSConfiguration.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.AluminumDesign.aluminumSLSConfiguration import AluminumDesignSLSConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_AluminumDesignServiceabilityConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.aluminum_design_active, status=True) 27 | 28 | Material(1, 'EN AW-3004 H24 | EN 1999-1-1:2007') 29 | 30 | Section(1, 'IPE 200') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | AluminumDesignSLSConfigurations(1, 'Test SLS') 40 | AluminumDesignSLSConfigurations(2, 'SLS2', '1') 41 | 42 | Model.clientModel.service.finish_modification() 43 | 44 | config1 = Model.clientModel.service.get_aluminum_design_sls_configuration(1) 45 | config2 = Model.clientModel.service.get_aluminum_design_sls_configuration(2) 46 | 47 | assert config1.name == "Test SLS" 48 | assert config2.assigned_to_members == '1' 49 | -------------------------------------------------------------------------------- /UnitTests/test_aluminumDesignULSConfigurations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.AluminumDesign.aluminumULSConfiguration import AluminumDesignULSConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_AluminumDesignUltimateConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.aluminum_design_active, status=True) 27 | 28 | Material(1, 'EN AW-3004 H24 | EN 1999-1-1:2007') 29 | 30 | Section(1, 'IPE 200') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | AluminumDesignULSConfigurations(1, name="myConfig") 40 | 41 | Model.clientModel.service.finish_modification() 42 | 43 | config = Model.clientModel.service.get_aluminum_design_uls_configuration(1) 44 | 45 | assert config.name == "myConfig" 46 | assert config.assigned_to_all_members == True 47 | -------------------------------------------------------------------------------- /UnitTests/test_aluminumEffectiveLengths.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import * 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.TypesForAluminumDesign.aluminumEffectiveLengths import AluminumEffectiveLengths 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_aluminumEffectiveLengths(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active) 22 | 23 | AluminumEffectiveLengths(1, "", "", True, False, False, False, True, False, 'SEL1') 24 | 25 | AluminumEffectiveLengths(2, "", "", False, False, False, True, True, False, 'SEL2', 26 | True, True, determination_of_mcr=SteelEffectiveLengthsDeterminationMcrEurope.DETERMINATION_EUROPE_USER_DEFINED) 27 | 28 | AluminumEffectiveLengths(3, "", "", True, False, False, False, True, True, 'SEL3') 29 | 30 | Model.clientModel.service.finish_modification() 31 | 32 | ef_1 = Model.clientModel.service.get_aluminum_effective_lengths(1) 33 | assert ef_1.flexural_buckling_about_y == True 34 | 35 | ef_2 = Model.clientModel.service.get_aluminum_effective_lengths(2) 36 | assert ef_2.no == 2 37 | assert ef_2.user_defined_name_enabled == True 38 | assert ef_2.name == "SEL2" 39 | assert ef_2.comment == None 40 | assert ef_2.members == "" 41 | assert ef_2.member_sets == "" 42 | assert ef_2.flexural_buckling_about_y == False 43 | assert ef_2.flexural_buckling_about_z == False 44 | assert ef_2.torsional_buckling == False 45 | assert ef_2.lateral_torsional_buckling == True 46 | assert ef_2.principal_section_axes == True 47 | assert ef_2.geometric_section_axes == False 48 | assert ef_2.factors_definition_absolute == False 49 | assert ef_2.intermediate_nodes == True 50 | assert ef_2.different_properties == True 51 | assert ef_2.principal_section_axes == True 52 | assert ef_2.nodal_supports[0][0].row['support_type'] == 'SUPPORT_TYPE_FIXED_IN_Z_Y_AND_TORSION' 53 | assert ef_2.determination_mcr_europe == SteelEffectiveLengthsDeterminationMcrEurope.DETERMINATION_EUROPE_USER_DEFINED.name 54 | 55 | ef_3 = Model.clientModel.service.get_aluminum_effective_lengths(3) 56 | assert ef_3.factors[0][0].row['flexural_buckling_u'] == 1 57 | assert ef_3.factors[0][0].row['flexural_buckling_y'] == 1 58 | -------------------------------------------------------------------------------- /UnitTests/test_aluminumMemberTransverseWeld.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, WeldComponentType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.TypesForAluminumDesign. aluminumMemberTransverseWelds import AluminumMemberTransverseWeld, transverseWeldComponent 12 | import pytest 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | @pytest.mark.skip(reason='AluminumMemberTransverseWeld is still in pre-release and althought "ns0:aluminum_member_transverse_weld" is available, the SetAddonStatus() causes an issue.') 18 | def test_aluminumMemberTransverseWeld(): 19 | 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active) 24 | 25 | AluminumMemberTransverseWeld(2, 'Weld_1', '', '', [transverseWeldComponent]) 26 | 27 | Model.clientModel.service.finish_modification() 28 | 29 | aw = Model.clientModel.service.get_aluminum_member_transverse_weld(2) 30 | assert aw.name == 'Weld_1' 31 | assert aw.components[0][0].row.weld_type == WeldComponentType.WELD_COMPONENT_TYPE_BUTT.name 32 | assert aw.components[0][0].row.position == 0.3 33 | -------------------------------------------------------------------------------- /UnitTests/test_availableActionCategories.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.initModel import Model 9 | from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations 10 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 11 | 12 | if Model.clientModel is None: 13 | Model() 14 | 15 | def test_availableActionCategories(): 16 | 17 | Model.clientModel.service.delete_all() 18 | Model.clientModel.service.begin_modification() 19 | 20 | LoadCasesAndCombinations(params={ 21 | "current_standard_for_combination_wizard" : 6042 22 | }) 23 | 24 | StaticAnalysisSettings() 25 | 26 | Model.clientModel.service.finish_modification() 27 | 28 | availableActionCategories = LoadCasesAndCombinations.getAvailableLoadActionCategoryTypes() 29 | 30 | assert len(availableActionCategories) == 19 31 | assert type(availableActionCategories) == list 32 | -------------------------------------------------------------------------------- /UnitTests/test_baseData.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.enums import ModelLocationRowType, ModelType 11 | from RFEM.baseData import ModelParameters, ModelParametersLocation, Modeltype 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_ModelParameters(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | ModelParameters([['Client name', 'ABC', 'c'], ['Company name', 'Dlubal Software GmbH', 'g'], ['Project name', 'Cantilever', 'h']]) 22 | 23 | Model.clientModel.service.finish_modification() 24 | 25 | mp = Model.clientModel.service.get_model_parameters() 26 | 27 | assert mp.model_parameters[0].no == 1 28 | assert mp.model_parameters[2].row['name'] == 'Client name' 29 | assert mp.model_parameters[3].row['description_1'] == 'Dlubal Software GmbH' 30 | assert mp.model_parameters[4].row['description_2'] == 'h' 31 | 32 | def test_ModelParametersLocation(): 33 | 34 | Model.clientModel.service.delete_all() 35 | Model.clientModel.service.begin_modification() 36 | 37 | ModelParametersLocation([[ModelLocationRowType.E_ROW_COUNTRY_ISO, 'Country', 'DEU', None], [ModelLocationRowType.E_ROW_STREET, 'Street', 'Lederstraße', None]]) 38 | 39 | Model.clientModel.service.finish_modification() 40 | 41 | mpl = Model.clientModel.service.get_model_parameters_location() 42 | assert mpl.model_parameters_location[0].row['location_row_type'] == 'E_ROW_COUNTRY_ISO' 43 | assert mpl.model_parameters_location[1].row['name'] == 'Street' 44 | assert mpl.model_parameters_location[0].row['value'] == 'DEU' 45 | 46 | def test_ModelType(): 47 | 48 | Model.clientModel.service.delete_all() 49 | Model.clientModel.service.begin_modification() 50 | 51 | Modeltype(ModelType.E_MODEL_TYPE_2D_XY_3D) 52 | 53 | Model.clientModel.service.finish_modification() 54 | 55 | mt = Model.clientModel.service.get_model_type() 56 | 57 | assert mt == 'E_MODEL_TYPE_2D_XY_3D' 58 | 59 | # Return the Model Type to its original state so that subsequent tests do not fail 60 | Modeltype(ModelType.E_MODEL_TYPE_3D) 61 | -------------------------------------------------------------------------------- /UnitTests/test_borehole.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import AddOn, MaterialModel 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.SpecialObjects.borehole import Borehole 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | def test_borehole(): 18 | 19 | SetAddonStatus(Model.clientModel, AddOn.geotechnical_analysis_active, True) 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | Material(1, 'Sand, closely graded (fine sand) | --') 24 | Material(2, 'Clay, medium plastic | --') 25 | Material(3, 'Gravel, well-graded (GW) | DIN 18196:2011-05') 26 | Material(4, 'Peat (Pt) | DIN 18196:2011-05') 27 | Material(5, 'Silt, inorganic, medium to high plasticity (MH) | DIN 18196:2011-05') 28 | 29 | Borehole(1, [0,0,0], None, [[1, 2.5], [3, 4.5], [2, 7]]) 30 | Borehole(2, [10,10,-2], 5, [[2, 3.5], [4, 7.5], [5, 9]], 'Borehole 2') 31 | 32 | Model.clientModel.service.finish_modification() 33 | 34 | bore1 = Model.clientModel.service.get_borehole(1) 35 | bore2 = Model.clientModel.service.get_borehole(2) 36 | 37 | assert bore1.no == 1 38 | assert bore1.groundwater == False 39 | assert bore1.layers_table[0][1].row['thickness'] == 4.5 40 | 41 | assert bore2.no == 2 42 | assert bore2.groundwater == True 43 | assert bore2.coordinate_2 == -2 44 | assert bore2.layers_table[0][0].row['thickness'] == 3.5 45 | assert bore2.name == 'Borehole 2' 46 | 47 | def test_getBorehole(): 48 | 49 | SetAddonStatus(Model.clientModel, AddOn.geotechnical_analysis_active, True) 50 | Model.clientModel.service.delete_all() 51 | Model.clientModel.service.begin_modification() 52 | 53 | Material(1, 'Sand, closely graded (fine sand) | --') 54 | Material(2, 'Clay, medium plastic | --') 55 | Material(3, 'Gravel, well-graded (GW) | DIN 18196:2011-05') 56 | 57 | Borehole(1, [0,0,0], None, [[1, 2.5], [3, 4.5], [2, 7]], name = 'Borehole') 58 | 59 | borehole = Borehole.GetBorehole(1) 60 | 61 | Model.clientModel.service.finish_modification() 62 | 63 | assert borehole['no'] == 1 64 | assert borehole['coordinate_2'] == 0 65 | assert borehole['name'] == 'Borehole' 66 | -------------------------------------------------------------------------------- /UnitTests/test_formula.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import sys 5 | import os 6 | PROJECT_ROOT = os.path.abspath(os.path.join( 7 | os.path.dirname(__file__), 8 | os.pardir) 9 | ) 10 | sys.path.append(PROJECT_ROOT) 11 | 12 | from RFEM.BasicObjects.node import Node 13 | from RFEM.formula import Formula 14 | from RFEM.initModel import Model 15 | from RFEM.enums import FormulaParameter 16 | import pytest 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_global_parameters(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | Node() 27 | Formula() 28 | with pytest.raises(ValueError): 29 | Formula(attribute='coordinate_x') 30 | 31 | Model.clientModel.service.finish_modification() 32 | 33 | attr_lst = Formula.GetListOfParametersFormulaAllowedFor() 34 | assert attr_lst == ['coordinate_1', 'coordinate_2', 'coordinate_3', 'global_coordinate_1', 'global_coordinate_2', 'global_coordinate_3'] 35 | assert Model.clientModel.service.get_node(1)['coordinate_1'] == 6 36 | assert Formula.Get() == '2*3' 37 | assert Formula.Get(formula_param=FormulaParameter.FORMULA) == '2*3' 38 | assert Formula.Get(formula_param=FormulaParameter.IS_VALID) == True 39 | assert Formula.Get(formula_param=FormulaParameter.CALCULATED_VALUE) == 6 40 | -------------------------------------------------------------------------------- /UnitTests/test_initModel.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import insertSpaces 10 | 11 | def test_insertSpaces(): 12 | """ 13 | Test conversion of list to string with spaces between items 14 | """ 15 | assert insertSpaces([1, 2, 3]) == "1 2 3" 16 | 17 | -------------------------------------------------------------------------------- /UnitTests/test_intersections.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import * 10 | from RFEM.initModel import Model 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.node import Node 13 | from RFEM.BasicObjects.line import Line 14 | from RFEM.BasicObjects.surface import Surface 15 | from RFEM.SpecialObjects.intersection import Intersection 16 | from RFEM.BasicObjects.thickness import Thickness 17 | 18 | 19 | if Model.clientModel is None: 20 | Model() 21 | 22 | def test_intersections(): 23 | 24 | Model.clientModel.service.delete_all() 25 | Model.clientModel.service.begin_modification() 26 | 27 | Material(1, 'S235') 28 | Thickness(1, 'Thick', 1, 0.35) 29 | 30 | Node(1, 0.1, 0, 0) 31 | Node(2, 4.9, 0, 0) 32 | Node(3, 4.9, 5, 0) 33 | Node(4, 0.1, 5, 0) 34 | 35 | Node(5, 0, 4, -3) 36 | Node(6, 5, 4, -3) 37 | Node(7, 5, 4, 3) 38 | Node(8, 0, 4, 3) 39 | 40 | Node(9, 3, 2.5, 1) 41 | Node(10, 2.5, 2.5, -2) 42 | 43 | Line(1, '1 2') 44 | Line(2, '2 3') 45 | Line(3, '3 4') 46 | Line(4, '4 1') 47 | 48 | Line(5, '5 6') 49 | Line(6, '6 7') 50 | Line(7, '7 8') 51 | Line(8, '8 5') 52 | 53 | Line(9, '9 10') 54 | 55 | Surface(1, '1-4') 56 | Surface(2, '5-8') 57 | Surface.Standard(3,SurfaceGeometry.GEOMETRY_PIPE, params={'pipe_radius':0.3, 'pipe_center_line':9}) 58 | 59 | Intersection(1,1,2) 60 | Intersection(2,1,3) 61 | 62 | Model.clientModel.service.finish_modification() 63 | 64 | int_1 = Model.clientModel.service.get_intersection(1) 65 | assert int_1.generated_lines == '13' 66 | assert int_1.generated_nodes == '15 16' 67 | assert int_1.surface_a == 1 68 | assert int_1.surface_b == 2 69 | 70 | int_2 = Model.clientModel.service.get_intersection(2) 71 | assert int_2.generated_lines == '14' 72 | assert int_2.generated_nodes == '17' 73 | assert int_2.surface_a == 1 74 | assert int_2.surface_b == 3 75 | -------------------------------------------------------------------------------- /UnitTests/test_loadCasesAndCombinations.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations 11 | 12 | if Model.clientModel is None: 13 | Model() 14 | 15 | def test_load_cases_and_combinations(): 16 | 17 | Model.clientModel.service.delete_all() 18 | Model.clientModel.service.begin_modification() 19 | 20 | LoadCasesAndCombinations( 21 | params = { 22 | "current_standard_for_combination_wizard": 6237, 23 | "activate_combination_wizard_and_classification": True, 24 | "activate_combination_wizard": True, 25 | "result_combinations_active": True, 26 | "result_combinations_parentheses_active": False, 27 | "result_combinations_consider_sub_results": False, 28 | "combination_name_according_to_action_category": False}) 29 | 30 | Model.clientModel.service.finish_modification() 31 | 32 | combConfig = Model.clientModel.service.get_load_cases_and_combinations() 33 | 34 | assert combConfig.current_standard_for_combination_wizard == 6237 35 | assert combConfig.result_combinations_parentheses_active == False 36 | 37 | # Return LoadCases and Combinations to the original state 38 | LoadCasesAndCombinations() 39 | -------------------------------------------------------------------------------- /UnitTests/test_loadCombination.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 11 | from RFEM.LoadCasesAndCombinations.loadCase import LoadCase 12 | from RFEM.LoadCasesAndCombinations.loadCombination import LoadCombination 13 | from RFEM.enums import ActionCategoryType, AnalysisType 14 | 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | def test_loadCombination(): 20 | 21 | Model.clientModel.service.delete_all() 22 | Model.clientModel.service.begin_modification() 23 | 24 | StaticAnalysisSettings.GeometricallyLinear(1, "Linear") 25 | 26 | LoadCase.StaticAnalysis(1, 'DEAD', True, 1, ActionCategoryType.ACTION_CATEGORY_PERMANENT_G, [True, 0, 0, 10]) 27 | LoadCase.StaticAnalysis(2, 'LIVE', True, 1, ActionCategoryType.ACTION_CATEGORY_PRESTRESS_P, [False]) 28 | LoadCase.StaticAnalysis(3) 29 | LoadCase(4) 30 | 31 | #LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, 'LC1', 1, combination_items=[[1.2, 1, 0, True], [1.6, 1, 0, False]]) 32 | LoadCombination(no=1, 33 | analysis_type=AnalysisType.ANALYSIS_TYPE_STATIC, 34 | name='CO1', 35 | static_analysis_settings=1, 36 | to_solve=True, 37 | combination_items=[ 38 | [1.35, 1, 0, False], 39 | [1.50, 2, 0, False] 40 | ]) 41 | 42 | Model.clientModel.service.finish_modification() 43 | 44 | comb = Model.clientModel.service.get_load_combination(1) 45 | 46 | assert comb.no == 1 47 | assert comb.analysis_type == "ANALYSIS_TYPE_STATIC" 48 | assert comb.design_situation == 1 49 | assert comb.user_defined_name_enabled == True 50 | assert comb.name == "CO1" 51 | assert comb.static_analysis_settings == 1 52 | assert comb.consider_imperfection == False 53 | assert comb.consider_initial_state == False 54 | assert comb.structure_modification_enabled == False 55 | assert comb.to_solve == True 56 | assert round(comb.items[0][0].row.factor, 2) == 1.35 57 | assert comb.items[0][0].row.load_case == 1 58 | -------------------------------------------------------------------------------- /UnitTests/test_memberDefinableStiffness.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.initModel import Model 9 | from RFEM.BasicObjects.node import Node 10 | from RFEM.TypesForMembers.memberDefinableStiffness import MemberDefinableStiffness 11 | 12 | if Model.clientModel is None: 13 | Model() 14 | 15 | ### Member Definable Stiffness Test ### 16 | def test_memberDefinableStiffness(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | Node(1, 0,0,0) 22 | Node(2, 5,0,0) 23 | Node(3, 0,5,0) 24 | Node(4, 5,5,0) 25 | 26 | MemberDefinableStiffness() 27 | MemberDefinableStiffness(2, 'Stiffness', '2', 100, 200, 300, 400, 500, 600, 700, 800, 90, 900, 1000, 1100) 28 | 29 | Model.clientModel.service.finish_modification() 30 | 31 | memberDefinableStiffness_1 = Model.clientModel.service.get_member_definable_stiffness(1) 32 | memberDefinableStiffness_2 = Model.clientModel.service.get_member_definable_stiffness(2) 33 | 34 | assert memberDefinableStiffness_1.no == 1 35 | assert memberDefinableStiffness_2.thermal_expansion_height == 1100 36 | 37 | -------------------------------------------------------------------------------- /UnitTests/test_memberRotationalRestraint.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import AddOn 11 | from RFEM.TypesForMembers.memberRotationalRestraint import MemberRotationalRestraint 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_memberRotationalRestraint(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active) 22 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active) 23 | SetAddonStatus(Model.clientModel, AddOn.steel_design_active) 24 | 25 | MemberRotationalRestraint.Continuous() 26 | 27 | MemberRotationalRestraint.Discrete(2, purlin_spacing=4) 28 | 29 | MemberRotationalRestraint.Manually(3, rotational_spring_stiffness=4000) 30 | 31 | Model.clientModel.service.finish_modification() 32 | 33 | rotationalRestraint1 = Model.clientModel.service.get_member_rotational_restraint(1) 34 | assert rotationalRestraint1.no == 1 35 | 36 | rotationalRestraint2 = Model.clientModel.service.get_member_rotational_restraint(2) 37 | assert rotationalRestraint2.purlin_spacing == 4 38 | 39 | rotationalRestraint3 = Model.clientModel.service.get_member_rotational_restraint(3) 40 | assert rotationalRestraint3.total_rotational_spring_stiffness == 4000 41 | -------------------------------------------------------------------------------- /UnitTests/test_memberShearPanel.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import AddOn 11 | from RFEM.TypesForMembers.memberShearPanel import MemberShearPanel 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_memberShearPanel(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active) 22 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active) 23 | SetAddonStatus(Model.clientModel, AddOn.steel_design_active) 24 | 25 | MemberShearPanel.TrapeziodalSheetingAndBracing() 26 | 27 | MemberShearPanel.TrapezodialSheeting() 28 | 29 | MemberShearPanel.Bracing(3, panel_length=4) 30 | 31 | MemberShearPanel.DefineSProv(4, shear_panel_stiffness=2000) 32 | 33 | Model.clientModel.service.finish_modification() 34 | 35 | shearPanel1 = Model.clientModel.service.get_member_shear_panel(1) 36 | assert shearPanel1.no == 1 37 | 38 | shearPanel3 = Model.clientModel.service.get_member_shear_panel(3) 39 | assert shearPanel3.panel_length == 4 40 | 41 | shearPanel4 = Model.clientModel.service.get_member_shear_panel(4) 42 | assert shearPanel4.stiffness == 2000 43 | -------------------------------------------------------------------------------- /UnitTests/test_memberSpring.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.enums import MemberSpringType, PartialActivityAlongType, MemberSpringSelfWeightDefinition, MemberSpringDiagramType 9 | from RFEM.initModel import Model 10 | from RFEM.BasicObjects.material import Material 11 | from RFEM.BasicObjects.node import Node 12 | from RFEM.BasicObjects.member import Member 13 | from RFEM.TypesForMembers.memberSpring import MemberSpring 14 | 15 | if Model.clientModel is None: 16 | Model() 17 | 18 | def test_MemberSpring(): 19 | 20 | Model.clientModel.service.delete_all() 21 | Model.clientModel.service.begin_modification() 22 | 23 | Material(1, 'S235') 24 | 25 | Node(1, 0, 0, 0) 26 | Node(2, 10, 0, 0) 27 | Node(3, 20, 0, 0) 28 | 29 | Member.Spring(1, 1, 2) 30 | 31 | MemberSpring(1, '1', MemberSpringType.PARTIAL_ACTIVITY, [[PartialActivityAlongType.PARTIAL_ACTIVITY_TYPE_COMPLETE, 0.1], \ 32 | [PartialActivityAlongType.PARTIAL_ACTIVITY_TYPE_FIXED, 0.15, 0.25]], 110, [MemberSpringSelfWeightDefinition.MASS_PER_LENGTH, 5], 'Spring 1') 33 | MemberSpring(2, '', MemberSpringType.DIAGRAM, [[True, MemberSpringDiagramType.DIAGRAM_ENDING_TYPE_FAILURE], \ 34 | [[0.01, 1000], [0.02, 1100], [0.035, 500]]], 20, [MemberSpringSelfWeightDefinition.SPECIFIC_WEIGHT, 1500, 0.012], 'Spring 2') 35 | 36 | Member.Spring(2, 2, 3, spring_type=2) 37 | 38 | Model.clientModel.service.finish_modification() 39 | 40 | ms1 = Model.clientModel.service.get_member_spring(1) 41 | assert ms1.assigned_to == '1' 42 | assert ms1.mass_per_length == 5 43 | 44 | ms2 = Model.clientModel.service.get_member_spring(2) 45 | assert ms2.name == 'Spring 2' 46 | assert ms2.axial_stiffness == 20 47 | -------------------------------------------------------------------------------- /UnitTests/test_memberSupport.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import AddOn 11 | from RFEM.dataTypes import inf 12 | from RFEM.TypesForMembers.memberRotationalRestraint import MemberRotationalRestraint 13 | from RFEM.TypesForMembers.memberShearPanel import MemberShearPanel 14 | from RFEM.TypesForMembers.memberSupport import MemberSupport 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | def test_memberSupport(): 20 | 21 | Model.clientModel.service.delete_all() 22 | Model.clientModel.service.begin_modification() 23 | 24 | SetAddonStatus(Model.clientModel, AddOn.aluminum_design_active) 25 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active) 26 | SetAddonStatus(Model.clientModel, AddOn.steel_design_active) 27 | 28 | MemberSupport(1, spring_translation_x=3000) 29 | 30 | MemberShearPanel.TrapezodialSheeting() 31 | MemberRotationalRestraint.Continuous() 32 | 33 | MemberSupport(3) 34 | 35 | Model.clientModel.service.finish_modification() 36 | 37 | memberSupport1 = Model.clientModel.service.get_member_support(1) 38 | assert memberSupport1.spring_translation_x == 3000 39 | 40 | memberSupport3 = Model.clientModel.service.get_member_support(3) 41 | assert memberSupport3.spring_translation_z == inf 42 | -------------------------------------------------------------------------------- /UnitTests/test_member_set.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import * 10 | from RFEM.initModel import Model 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.BasicObjects.memberSet import MemberSet 16 | 17 | if Model.clientModel is None: 18 | Model() 19 | 20 | def test_member_set(): 21 | 22 | Model.clientModel.service.delete_all() 23 | Model.clientModel.service.begin_modification() 24 | 25 | Node(1, 0, 0, 0) 26 | Node(2, 5, 0, 0) 27 | Node(3, 10, 0, 0) 28 | 29 | Material(1, 'S235') 30 | 31 | Section(1, 'IPE 300', 1) 32 | 33 | Member(1, 1, 2, 0, 1, 1) 34 | Member(2, 2, 3, 0, 1, 1) 35 | 36 | MemberSet(1, '1 2', SetType.SET_TYPE_CONTINUOUS) 37 | 38 | Model.clientModel.service.finish_modification() 39 | 40 | member_set = Model.clientModel.service.get_member_set(1) 41 | 42 | assert member_set.members == '1 2' 43 | assert member_set.length == 10 44 | assert member_set.set_type == SetType.SET_TYPE_CONTINUOUS.name 45 | 46 | def test_member_set_continuous(): 47 | 48 | Model.clientModel.service.delete_all() 49 | Model.clientModel.service.begin_modification() 50 | 51 | Node(1, 0, 0, 0) 52 | Node(2, 5, 0, 0) 53 | Node(3, 5, 0, 5) 54 | 55 | Material(1, 'S235') 56 | 57 | Section(1, 'IPE 300', 1) 58 | 59 | Member(1, 1, 2, 0, 1, 1) 60 | Member(2, 2, 3, 0, 1, 1) 61 | 62 | MemberSet.ContinuousMembers(1, '1 2') 63 | 64 | Model.clientModel.service.finish_modification() 65 | 66 | member_set = Model.clientModel.service.get_member_set(1) 67 | 68 | assert member_set.members == '1 2' 69 | assert member_set.length == 10 70 | assert member_set.set_type == SetType.SET_TYPE_CONTINUOUS.name 71 | 72 | def test_member_set_group(): 73 | 74 | Model.clientModel.service.delete_all() 75 | Model.clientModel.service.begin_modification() 76 | 77 | Node(1, 0, 0, 0) 78 | Node(2, 5, 0, 0) 79 | Node(3, 5, 5, 0) 80 | 81 | Material(1, 'S235') 82 | 83 | Section(1, 'IPE 300', 1) 84 | 85 | Member(1, 1, 2, 0, 1, 1) 86 | Member(2, 2, 3, 0, 1, 1) 87 | 88 | MemberSet.GroupOfmembers(1, '1 2') 89 | 90 | Model.clientModel.service.finish_modification() 91 | 92 | member_set = Model.clientModel.service.get_member_set(1) 93 | 94 | assert member_set.members == '1 2' 95 | assert member_set.length == 10 96 | assert member_set.set_type == SetType.SET_TYPE_GROUP.name 97 | -------------------------------------------------------------------------------- /UnitTests/test_modelInfo.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.initModel import Model 10 | from RFEM.initModel import GetModelParameters, GetModelMainParameters, GetModelId, GetName, GetLanguage, GetVersion 11 | sys.path.append('..') 12 | from RFEM import connectionGlobals 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | def test_ModelParameters(): 18 | 19 | Model.clientModel.service.delete_all() 20 | 21 | m = GetModelParameters() 22 | 23 | assert m.model_parameters[0].no == 1 24 | assert m.model_parameters[2].row['name'] == 'Client name' 25 | assert m.model_parameters[1].row['description_2'] == 'Unique project identifier' 26 | assert m.model_parameters[3].row['description_2'] in [None, 'g'] 27 | 28 | def test_ModelMainParameters(): 29 | 30 | Model.clientModel.service.delete_all() 31 | 32 | m = GetModelMainParameters() 33 | mi = GetModelId() 34 | 35 | act_mi = Model.clientModel.service.get_model_main_parameters().model_id 36 | 37 | assert m.model_name == 'TestModel' 38 | assert mi == act_mi 39 | 40 | def test_Application(): 41 | 42 | Model.clientModel.service.delete_all() 43 | 44 | name = GetName() 45 | version = GetVersion() 46 | language = GetLanguage() 47 | 48 | an = connectionGlobals.client.service.get_information() 49 | 50 | assert an.name == name 51 | assert an.version == version 52 | assert an.language_name == language 53 | -------------------------------------------------------------------------------- /UnitTests/test_multipleModels.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.BasicObjects.material import Material 9 | from RFEM.initModel import Model, closeModel 10 | 11 | if Model.clientModel is None: 12 | Model() 13 | 14 | def test_multiple_models_with_parameter(): 15 | 16 | model1 = Model(True, 'TestModel5') 17 | Material(1,'S235', model = model1) 18 | 19 | model2 = Model(True, 'TestModel6') 20 | Material(2,'S235', model = model1) 21 | Material(3,'S275', model = model2) 22 | Material(4,'S235', model = model1) 23 | Material(5,'S275', model = model2) 24 | 25 | assert model1.clientModel.service.get_material(1).name in ["S235 | EN 1993-1-1:2005-05", "S235 | CYS EN 1993-1-1:2009-03"] 26 | assert model1.clientModel.service.get_material(2).name == "S235 | CYS EN 1993-1-1:2009-03" 27 | assert model1.clientModel.service.get_material(4).name == "S235 | CYS EN 1993-1-1:2009-03" 28 | 29 | assert model2.clientModel.service.get_material(3).name == "S275 | CYS EN 1993-1-1:2009-03" 30 | assert model2.clientModel.service.get_material(5).name == "S275 | CYS EN 1993-1-1:2009-03" 31 | 32 | closeModel(2) 33 | closeModel(1) 34 | 35 | def test_multiple_models_calling_class(): 36 | 37 | model1 = Model(True, 'TestModel5') 38 | Material(1,'S235') 39 | Material(2,'S235') 40 | 41 | model2 = Model(True, 'TestModel6') 42 | Material(3,'S275') 43 | 44 | Model(False, 'TestModel5') 45 | Material(4,'S235') 46 | 47 | Model(False, 'TestModel6') 48 | Material(5,'S275') 49 | 50 | assert model1.clientModel.service.get_material(1).name in ["S235 | EN 1993-1-1:2005-05", "S235 | CYS EN 1993-1-1:2009-03"] 51 | assert model1.clientModel.service.get_material(2).name == "S235 | CYS EN 1993-1-1:2009-03" 52 | assert model1.clientModel.service.get_material(4).name == "S235 | CYS EN 1993-1-1:2009-03" 53 | 54 | assert model2.clientModel.service.get_material(3).name == "S275 | CYS EN 1993-1-1:2009-03" 55 | assert model2.clientModel.service.get_material(5).name == "S275 | CYS EN 1993-1-1:2009-03" 56 | 57 | closeModel(2) 58 | closeModel(1) 59 | -------------------------------------------------------------------------------- /UnitTests/test_node.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import * 10 | from RFEM.initModel import Model 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.line import Line 15 | from RFEM.BasicObjects.member import Member 16 | 17 | if Model.clientModel is None: 18 | Model() 19 | 20 | def test_node(): 21 | 22 | Model.clientModel.service.delete_all() 23 | Model.clientModel.service.begin_modification() 24 | 25 | Node(1, 0, 0, 0) 26 | Node(2, 5, 0, 0) 27 | Node.Standard(3, [5, 5, 0],NodeCoordinateSystemType.COORDINATE_SYSTEM_CARTESIAN) 28 | Node.BetweenTwoNodes(4,2,3,NodeReferenceType.REFERENCE_TYPE_L, 1, [True, 0.60]) 29 | Node.BetweenTwoPoints(5,0,0,0,6,0,0,NodeReferenceType.REFERENCE_TYPE_L, [True, 0.7], 1, 1) 30 | 31 | Line(1,'1 2') 32 | Node.OnLine(6, 1, NodeReferenceType.REFERENCE_TYPE_L, 1, [True, 0.50]) 33 | 34 | Material(1, 'S235') 35 | Section(1, 'IPE 300', 1) 36 | Member(1, 1, 2, 0, 1, 1) 37 | Node.OnMember(7,1,NodeReferenceType.REFERENCE_TYPE_L) 38 | 39 | Model.clientModel.service.finish_modification() 40 | 41 | node = Model.clientModel.service.get_node(1) 42 | assert node.type == 'TYPE_STANDARD' 43 | node = Model.clientModel.service.get_node(3) 44 | assert node.type == 'TYPE_STANDARD' 45 | node = Model.clientModel.service.get_node(4) 46 | assert node.type == 'TYPE_BETWEEN_TWO_NODES' 47 | node = Model.clientModel.service.get_node(5) 48 | assert node.type == 'TYPE_BETWEEN_TWO_POINTS' 49 | node = Model.clientModel.service.get_node(7) 50 | assert node.type == 'TYPE_ON_MEMBER' 51 | 52 | def test_node_delete(): 53 | 54 | Model.clientModel.service.delete_all() 55 | Model.clientModel.service.begin_modification() 56 | 57 | Node(1, 0, 0, 0) 58 | Node(2, 0, 0, -5) 59 | Node(3, 0, 0, -10) 60 | 61 | Node.DeleteNode('1 3') 62 | 63 | Model.clientModel.service.finish_modification() 64 | 65 | modelInfo = Model.clientModel.service.get_model_info() 66 | 67 | assert modelInfo.property_node_count == 1 -------------------------------------------------------------------------------- /UnitTests/test_note.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import NoteType, NoteOffsetType, NoteMemberReferenceType 10 | from RFEM.initModel import Model 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.GuideObjects.note import Note 16 | 17 | if Model.clientModel is None: 18 | Model() 19 | 20 | def test_note(): 21 | 22 | Model.clientModel.service.delete_all() 23 | Model.clientModel.service.begin_modification() 24 | 25 | Material() 26 | Section() 27 | Node(1, 0, 0, 0) 28 | Node(2, 10, 0, 0) 29 | Node(3, 10, 10, 0) 30 | Node(4, 0, 10, 0) 31 | 32 | Member(1, 1, 2) 33 | 34 | Note(1, 'Point 1', NoteType.NOTE_TYPE_POINT, [5, 0, -5], None, 0, 0) 35 | Note(2, 'Node 2', NoteType.NOTE_TYPE_NODE, 2, [NoteOffsetType.OFFSET_TYPE_XYZ, 3, -2, -3], 0.1, 1, 'Node', True) 36 | Note(4, 'Member 1', NoteType.NOTE_TYPE_MEMBER, [1, NoteMemberReferenceType.REFERENCE_TYPE_XY, False, 7], [NoteOffsetType.OFFSET_TYPE_XZ, -2, -2], 0, 3) 37 | 38 | Model.clientModel.service.finish_modification() 39 | 40 | note1 = Model.clientModel.service.get_note(1) 41 | assert note1.type == 'NOTE_TYPE_POINT' 42 | assert note1.offset == False 43 | 44 | note2 = Model.clientModel.service.get_note(2) 45 | assert note2.node == 2 46 | assert note2.offset_type == 'OFFSET_TYPE_XYZ' 47 | assert note2.name == 'Node' 48 | 49 | note4 = Model.clientModel.service.get_note(4) 50 | assert note4.member == 1 51 | assert note4.member_distance_absolute == 7 52 | -------------------------------------------------------------------------------- /UnitTests/test_plausiblityCheck.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | from RFEM.TypesForNodes.nodalSupport import NodalSupport, NodalSupportType 9 | from RFEM.BasicObjects.member import Member 10 | from RFEM.BasicObjects.node import Node 11 | from RFEM.BasicObjects.section import Section 12 | from RFEM.BasicObjects.material import Material 13 | from RFEM.initModel import Model 14 | from RFEM.Tools.PlausibilityCheck import PlausibilityCheck 15 | 16 | if Model.clientModel is None: 17 | Model() 18 | 19 | def test_plausibility_check(): 20 | 21 | Model.clientModel.service.delete_all() 22 | Model.clientModel.service.begin_modification() 23 | 24 | # Create Material 25 | Material(1, 'S235') 26 | 27 | # Create Sections 28 | Section(1, 'HEA 240', 1) 29 | 30 | # Create Nodes 31 | Node(1, 0, 0, 0) 32 | Node(2, 6, 0, 0) 33 | 34 | # Create Members 35 | Member(1, 1, 2, 0, 1, 1) 36 | 37 | # Create Nodal Supports 38 | NodalSupport(1, '1', NodalSupportType.FIXED) 39 | 40 | Model.clientModel.service.finish_modification() 41 | 42 | PlausibilityCheck() 43 | -------------------------------------------------------------------------------- /UnitTests/test_saveFile.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | dirName = os.path.dirname(__file__) 8 | sys.path.append(PROJECT_ROOT) 9 | 10 | from RFEM.initModel import Model, saveFile, closeModel 11 | from RFEM.BasicObjects.material import Material 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_SaveFile(): 17 | 18 | if (os.path.isfile("/testResults/save.rf6")): 19 | os.remove("/testResults/save.rf6") 20 | 21 | Model(True, 'save.rf6') 22 | Model.clientModel.service.delete_all() 23 | 24 | Material(1, 'S235') 25 | 26 | saveFile(dirName + '/testResults/save.rf6') 27 | 28 | closeModel('save.rf6') 29 | 30 | assert os.path.isfile(dirName + "/testResults/save.rf6") 31 | #os.remove(dirName + '/testResults/save.rf6') 32 | -------------------------------------------------------------------------------- /UnitTests/test_staticAnalysisSetting.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | PROJECT_ROOT = os.path.abspath(os.path.join( 5 | os.path.dirname(__file__), 6 | os.pardir) 7 | ) 8 | sys.path.append(PROJECT_ROOT) 9 | from RFEM.initModel import Model 10 | from RFEM.enums import StaticAnalysisType, StaticAnalysisSettingsMethodOfEquationSystem, StaticAnalysisSettingsPlateBendingTheory 11 | from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_StaticAnalysisSettings(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | # Set Static Analysis Settings 22 | StaticAnalysisSettings(1, 'Geometrisch-linear', StaticAnalysisType.GEOMETRICALLY_LINEAR) 23 | StaticAnalysisSettings.GeometricallyLinear(2,'Geometric-linear',[True, 1.5, True],True,True, 24 | StaticAnalysisSettingsMethodOfEquationSystem.METHOD_OF_EQUATION_SYSTEM_ITERATIVE, 25 | StaticAnalysisSettingsPlateBendingTheory.PLATE_BENDING_THEORY_KIRCHHOFF,[True,0,0,2.0]) 26 | StaticAnalysisSettings.LargeDeformation(3,standard_precision_and_tolerance_settings = [True, 0.02, 0.02, 2.0]) 27 | StaticAnalysisSettings.SecondOrderPDelta(4) 28 | 29 | Model.clientModel.service.finish_modification() 30 | 31 | linear = Model.clientModel.service.get_static_analysis_settings(2) 32 | assert linear['modify_loading_by_multiplier_factor'] == True 33 | assert linear['loading_multiplier_factor'] == 1.5 34 | assert linear['divide_results_by_loading_factor'] == True 35 | largeDef= Model.clientModel.service.get_static_analysis_settings(3) 36 | assert largeDef['standard_precision_and_tolerance_settings_enabled'] == True 37 | assert largeDef['precision_of_convergence_criteria_for_nonlinear_calculation'] == 0.02 38 | assert largeDef['instability_detection_tolerance'] == 0.02 39 | assert largeDef['iterative_calculation_robustness'] == 2.0 40 | secondOrder = Model.clientModel.service.get_static_analysis_settings(4) 41 | assert secondOrder['analysis_type'] == StaticAnalysisType.SECOND_ORDER_P_DELTA.name 42 | -------------------------------------------------------------------------------- /UnitTests/test_steelDesignServiceabilityConfiguration.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.SteelDesign.steelServiceabilityConfiguration import SteelDesignServiceabilityConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_SteelDesignServiceabilityConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.steel_design_active, status=True) 27 | 28 | Material(1, 'S235') 29 | 30 | Section(1, 'IPE 200') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | SteelDesignServiceabilityConfigurations(1, 'Test SLS') 40 | SteelDesignServiceabilityConfigurations(2, 'SLS2', '1') 41 | 42 | Model.clientModel.service.finish_modification() 43 | 44 | config1 = Model.clientModel.service.get_steel_design_sls_configuration(1) 45 | config2 = Model.clientModel.service.get_steel_design_sls_configuration(2) 46 | 47 | assert config1.name == "Test SLS" 48 | assert config2.assigned_to_members == '1' 49 | -------------------------------------------------------------------------------- /UnitTests/test_steelDesignUltimateConfigurations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.SteelDesign.steelUltimateConfigurations import SteelDesignUltimateConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_SteelDesignUltimateConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.steel_design_active, status=True) 27 | 28 | Material(1, 'S235') 29 | 30 | Section(1, 'IPE 200') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | SteelDesignUltimateConfigurations(1, name="myConfig") 40 | 41 | Model.clientModel.service.finish_modification() 42 | 43 | config = Model.clientModel.service.get_steel_design_uls_configuration(1) 44 | 45 | assert config.name == "myConfig" 46 | assert config.assigned_to_all_members == True 47 | 48 | -------------------------------------------------------------------------------- /UnitTests/test_timberDesignFireConfigurations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.TimberDesign.timberFireConfiguration import TimberDesignFireConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_timberDesignFireConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.timber_design_active, status=True) 27 | 28 | Material(1, 'C24 | EN 338:2016-04') 29 | 30 | Section(1, 'R_M1 0.18/0.36') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | TimberDesignFireConfigurations(1, name="myConfig") 40 | 41 | Model.clientModel.service.finish_modification() 42 | 43 | config = Model.clientModel.service.get_timber_design_fr_configuration(1) 44 | 45 | assert config.name == "myConfig" 46 | assert config.assigned_to_all_members == True 47 | -------------------------------------------------------------------------------- /UnitTests/test_timberDesignServiceLimitStateConfigurations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.TimberDesign.timberServiceLimitStateConfigurations import TimberDesignServiceLimitStateConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_timberDesignServiceLimitStateConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.timber_design_active, status=True) 27 | 28 | Material(1, 'C24 | EN 338:2016-04') 29 | 30 | Section(1, 'R_M1 0.18/0.36') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | TimberDesignServiceLimitStateConfigurations(1, name="myConfig") 40 | 41 | Model.clientModel.service.finish_modification() 42 | 43 | config = Model.clientModel.service.get_timber_design_sls_configuration(1) 44 | 45 | assert config.name == "myConfig" 46 | assert config.assigned_to_all_members == True 47 | 48 | -------------------------------------------------------------------------------- /UnitTests/test_timberDesignUltimateConfigurations.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, NodalSupportType 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForNodes.nodalSupport import NodalSupport 16 | from RFEM.TimberDesign.timberUltimateConfigurations import TimberDesignUltimateConfigurations 17 | 18 | if Model.clientModel is None: 19 | Model() 20 | 21 | def test_TimberDesignUltimateConfigurations(): 22 | 23 | Model.clientModel.service.delete_all() 24 | Model.clientModel.service.begin_modification() 25 | 26 | SetAddonStatus(Model.clientModel, addOn=AddOn.timber_design_active, status=True) 27 | 28 | Material(1, 'C24 | EN 338:2016-04') 29 | 30 | Section(1, 'R_M1 0.18/0.36') 31 | 32 | Node(1, 0.0, 0.0, 0.0) 33 | Node(2, 5, 0.0, 0.0) 34 | 35 | Member(1, 1, 2, 0.0, 1, 1) 36 | 37 | NodalSupport(1, '1', NodalSupportType.FIXED) 38 | 39 | TimberDesignUltimateConfigurations(1, name="myConfig") 40 | 41 | Model.clientModel.service.finish_modification() 42 | 43 | config = Model.clientModel.service.get_timber_design_uls_configuration(1) 44 | 45 | assert config.name == "myConfig" 46 | assert config.assigned_to_all_members == True 47 | 48 | -------------------------------------------------------------------------------- /UnitTests/test_timberEffectiveLengths.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import * 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.TypesForTimberDesign.timberEffectiveLengths import TimberEffectiveLengths 12 | 13 | if Model.clientModel is None: 14 | Model() 15 | 16 | def test_timberEffectiveLengths(): 17 | 18 | Model.clientModel.service.delete_all() 19 | Model.clientModel.service.begin_modification() 20 | 21 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active, True) 22 | 23 | TimberEffectiveLengths() 24 | 25 | Model.clientModel.service.finish_modification() 26 | 27 | tel = Model.clientModel.service.get_timber_effective_lengths(1) 28 | assert tel.flexural_buckling_about_y == True 29 | assert tel.flexural_buckling_about_z == True 30 | assert tel.intermediate_nodes == False 31 | assert tel.different_properties == True 32 | assert tel.factors_definition_absolute == False 33 | assert tel.fire_design_different_buckling_factors == False 34 | assert tel.import_from_stability_analysis_enabled == False 35 | assert tel.determination_type == TimberEffectiveLengthsDeterminationType.DETERMINATION_EIGENVALUE_SOLVER.name 36 | assert tel.nodal_supports[0][0].row.support_type == TimberEffectiveLengthsSupportType.SUPPORT_TYPE_FIXED_IN_Z_Y_AND_TORSION.name 37 | assert tel.nodal_supports[0][0].row.support_in_z == True 38 | assert tel.nodal_supports[0][0].row.eccentricity_type == TimberEffectiveLengthsEccentricityType.ECCENTRICITY_TYPE_NONE.name 39 | -------------------------------------------------------------------------------- /UnitTests/test_timberMoistureClass.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, TimberMoistureClassType 10 | from RFEM.initModel import Model, SetAddonStatus, AddOn, openFile, closeModel 11 | from RFEM.connectionGlobals import url 12 | from RFEM.BasicObjects.material import Material 13 | from RFEM.BasicObjects.section import Section 14 | from RFEM.BasicObjects.node import Node 15 | from RFEM.BasicObjects.member import Member 16 | from RFEM.TypesForTimberDesign.timberMoistureClass import TimberMoistureClass 17 | from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations 18 | import pytest 19 | 20 | if Model.clientModel is None: 21 | Model() 22 | 23 | @pytest.mark.skipif(url != 'http://127.0.0.1', reason="This test fails on remote PC due to incorrect file path. \ 24 | Althought it is easy to change, it would not be easy to update on every remote computer.\ 25 | It is not necessary to evaluate Client as functional. Localy this tests still gets executed.") 26 | 27 | def test_timberMoistureClass(): 28 | 29 | dirname = os.path.join(os.getcwd(), os.path.dirname(__file__)) 30 | openFile(os.path.join(dirname, 'src', 'timberMoistureClass.rf6')) 31 | 32 | Model.clientModel.service.delete_all() 33 | Model.clientModel.service.begin_modification() 34 | 35 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active, True) 36 | 37 | Node(1, 0, 0, 0) 38 | Node(2, 5, 0, 0) 39 | Material(1, 'KLH (20 mm) | KLH') 40 | Section(1, 'R_M1 0.2/0.5', 1) 41 | Member(1, 1, 2, 0, 1, 1) 42 | 43 | LoadCasesAndCombinations( 44 | params = { 45 | "current_standard_for_combination_wizard": 6226, 46 | "activate_combination_wizard_and_classification": True, 47 | "activate_combination_wizard": True, 48 | "result_combinations_active": True, 49 | "result_combinations_parentheses_active": False, 50 | "result_combinations_consider_sub_results": False, 51 | "combination_name_according_to_action_category": False}) 52 | 53 | TimberMoistureClass(no = 1, members='1', moisture_class=TimberMoistureClassType.TIMBER_MOISTURE_CLASS_TYPE_2) 54 | 55 | Model.clientModel.service.finish_modification() 56 | 57 | tmc = Model.clientModel.service.get_timber_moisture_class(1) 58 | assert tmc.members == '1' 59 | assert tmc.moisture_class == TimberMoistureClassType.TIMBER_MOISTURE_CLASS_TYPE_2.name 60 | 61 | closeModel('timberMoistureClass.rf6') 62 | -------------------------------------------------------------------------------- /UnitTests/test_timberServiceClass.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | PROJECT_ROOT = os.path.abspath(os.path.join( 4 | os.path.dirname(__file__), 5 | os.pardir) 6 | ) 7 | sys.path.append(PROJECT_ROOT) 8 | 9 | from RFEM.enums import AddOn, TimberServiceClassServiceClass 10 | from RFEM.initModel import Model, SetAddonStatus 11 | from RFEM.BasicObjects.material import Material 12 | from RFEM.BasicObjects.section import Section 13 | from RFEM.BasicObjects.node import Node 14 | from RFEM.BasicObjects.member import Member 15 | from RFEM.TypesForTimberDesign.timberServiceClass import TimberServiceClass 16 | 17 | if Model.clientModel is None: 18 | Model() 19 | 20 | def test_timberServiceClass(): 21 | 22 | Model.clientModel.service.delete_all() 23 | Model.clientModel.service.begin_modification() 24 | 25 | SetAddonStatus(Model.clientModel, AddOn.timber_design_active, True) 26 | 27 | Node(1, 0, 0, 0) 28 | Node(2, 5, 0, 0) 29 | Node(3, 10, 0, 0) 30 | Material(1, 'KLH (20 mm) | KLH') 31 | Section(1, 'R_M1 0.2/0.5', 1) 32 | Member(1, 1, 2, 0, 1, 1) 33 | Member(2, 2, 3, 0, 1, 1) 34 | 35 | TimberServiceClass(members='1 2', service_class=TimberServiceClassServiceClass.TIMBER_SERVICE_CLASS_TYPE_2) 36 | 37 | Model.clientModel.service.finish_modification() 38 | 39 | tsc = Model.clientModel.service.get_timber_service_class(1) 40 | 41 | assert tsc.members == '1 2' 42 | assert tsc.service_class == TimberServiceClassServiceClass.TIMBER_SERVICE_CLASS_TYPE_2.name 43 | -------------------------------------------------------------------------------- /UnitTests/test_windSimulationAnalysisSetting.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | PROJECT_ROOT = os.path.abspath(os.path.join( 5 | os.path.dirname(__file__), 6 | os.pardir) 7 | ) 8 | sys.path.append(PROJECT_ROOT) 9 | from RFEM.initModel import Model, SetAddonStatus 10 | from RFEM.enums import WindSimulationAnalysisSettingsSimulationType, WindSimulationAnalysisSettingsMemberLoadDistribution 11 | from RFEM.enums import WindSimulationAnalysisSettingsNumericalSolver, WindSimulationAnalysisSettingsTurbulenceModelType, AddOn 12 | from RFEM.LoadCasesAndCombinations.windSimulationAnalysisSetting import WindSimulationAnalysisSettings 13 | 14 | if Model.clientModel is None: 15 | Model() 16 | 17 | def test_WindSimulationAnalysisSettings(): 18 | 19 | Model.clientModel.service.delete_all() 20 | Model.clientModel.service.begin_modification() 21 | 22 | SetAddonStatus(Model.clientModel, AddOn.wind_simulation_active, True) 23 | 24 | # Set Static Analysis Settings 25 | WindSimulationAnalysisSettings(1, 'Steady Flow', 1.25, 0.000015, WindSimulationAnalysisSettingsMemberLoadDistribution.CONCENTRATED, 26 | 0.1, True, [False, 500, WindSimulationAnalysisSettingsTurbulenceModelType.TURBULENCE_TYPE_EPSILON]) 27 | WindSimulationAnalysisSettings.TransientFlow(2,'Transient Flow', 1.3, 0.00002, 0.3, [True, 250, WindSimulationAnalysisSettingsTurbulenceModelType.TURBULENCE_TYPE_EPSILON, 0.03]) 28 | 29 | Model.clientModel.service.finish_modification() 30 | 31 | steady_flow = Model.clientModel.service.get_wind_simulation_analysis_settings(1) 32 | assert steady_flow['simulation_type'] == WindSimulationAnalysisSettingsSimulationType.STEADY_FLOW.name 33 | assert steady_flow['density'] == 1.25 34 | assert steady_flow['kinematic_viscosity'] == 0.000015 35 | assert steady_flow['member_load_distribution'] == WindSimulationAnalysisSettingsMemberLoadDistribution.CONCENTRATED.name 36 | assert steady_flow['numerical_solver'] == WindSimulationAnalysisSettingsNumericalSolver.OPEN_FOAM.name 37 | assert steady_flow['consider_turbulence'] == True 38 | 39 | transient_flow = Model.clientModel.service.get_wind_simulation_analysis_settings(2) 40 | assert transient_flow['steady_flow_from_solver'] == True 41 | assert transient_flow['maximum_number_of_iterations'] == 250 42 | assert transient_flow['turbulence_model_type_for_initial_condition'] == WindSimulationAnalysisSettingsTurbulenceModelType.TURBULENCE_TYPE_EPSILON.name 43 | assert transient_flow['data_compression_error_tolerance'] == 0.03 44 | -------------------------------------------------------------------------------- /UnitTests/tools.py: -------------------------------------------------------------------------------- 1 | def getPathToRunningRFEM(): 2 | ''' 3 | Find the path to the directory where RFEM is currently running. 4 | This is helpful when using server version, because it can't process relative paths. 5 | ''' 6 | import psutil 7 | rstab9 = False 8 | rstab9Server = False 9 | path = '' 10 | 11 | for p in psutil.process_iter(['name', 'exe']): 12 | if p.info['name'] == 'RFEM6.exe': 13 | idx = p.info['exe'].find('bin') 14 | path = p.info['exe'][:idx] 15 | elif p.info['name'] == 'RFEM6Server.exe': 16 | idx = p.info['exe'].find('bin') 17 | path = p.info['exe'][:idx] 18 | elif p.info['name'] == 'RSTAB9.exe': 19 | rstab9 = True 20 | elif p.info['name'] == 'RSTAB9Server.exe': 21 | rstab9Server = True 22 | 23 | if rstab9 or rstab9Server: 24 | raise ValueError('Careful! You are running RFEM Python Client on RSTAB.') 25 | if not path: 26 | raise ValueError('Is it possible that RFEM is not runnnning?') 27 | 28 | return path -------------------------------------------------------------------------------- /img/2Dtruss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/2Dtruss.gif -------------------------------------------------------------------------------- /img/PyPI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/PyPI.png -------------------------------------------------------------------------------- /img/Python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/Python.png -------------------------------------------------------------------------------- /img/RFEM.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/RFEM.gif -------------------------------------------------------------------------------- /img/RFEM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/RFEM.png -------------------------------------------------------------------------------- /img/RSTAB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/RSTAB.png -------------------------------------------------------------------------------- /img/csharp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/csharp.png -------------------------------------------------------------------------------- /img/github-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/github-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/globe-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/globe-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/instagram-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/instagram-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/linkedin-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/linkedin-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/logo.gif -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlubal-software/RFEM_Python_Client/04f3ef8afb4f24f780d6b253346dac04061a8995/img/logo.png -------------------------------------------------------------------------------- /img/terminal-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/terminal-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/twitter-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/twitter-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/youtube-dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/youtube-light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | ## Type of change 6 | 7 | - [ ] Bug fix (non-breaking change which fixes an issue) 8 | - [ ] New feature (non-breaking change which adds functionality) 9 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 10 | - [ ] Documentation update 11 | 12 | # How Has This Been Tested? 13 | 14 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration 15 | 16 | - [ ] Unit Tests 17 | - [ ] Attached examples 18 | 19 | **Test Configuration**: 20 | * RFEM version: 21 | * Python version: 22 | 23 | 24 | # Checklist: 25 | 26 | - [ ] My code follows the style guidelines of this project 27 | - [ ] I have performed a self-review of my own code 28 | - [ ] I have commented my code, particularly in hard-to-understand areas 29 | - [ ] I have made corresponding changes to the documentation 30 | - [ ] My changes generate no new warnings 31 | - [ ] I have added tests that prove my fix is effective or that my feature works 32 | - [ ] New and existing unit tests pass locally with my changes 33 | - [ ] Any dependent changes have been merged and published in downstream modules 34 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages 2 | from setuptools import setup 3 | import pathlib 4 | 5 | here = pathlib.Path(__file__).parent 6 | readme = (here/"README.md").read_text(encoding="utf-8") 7 | 8 | setup( 9 | name='RFEM', 10 | version='1.20.5', 11 | description='Python Framework for RFEM6 Web Services', 12 | long_description=readme, 13 | long_description_content_type = "text/markdown", 14 | url="https://github.com/Dlubal-Software/RFEM_Python_Client", 15 | author="Dlubal Software", 16 | author_email="info@dlubal.com", 17 | license="MIT", 18 | classifiers=[ 19 | "License :: OSI Approved :: MIT License", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3.10", 22 | "Programming Language :: Python :: 3.11" 23 | ], 24 | packages=find_packages(), 25 | package_dir={"RFEM":"RFEM"}, 26 | include_package_data=True, 27 | install_requires=["requests", "six", "suds-py3", "xmltodict", "pytest", "mock", "setuptools"], 28 | zip_safe = False 29 | ) 30 | --------------------------------------------------------------------------------