{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.001764, "end_time": "2026-03-19T15:26:12.502633", "exception": false, "start_time": "2026-03-19T15:26:12.500869", "status": "completed" }, "tags": [] }, "source": [ "(Bolt Script Example)=\n", "# Bolt Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001543, "end_time": "2026-03-19T15:26:12.505935", "exception": false, "start_time": "2026-03-19T15:26:12.504392", "status": "completed" }, "tags": [] }, "source": [ "Download the [ExampleModel.fez](https://github.com/Rocscience/rs2-scripting/blob/main/docs/example_code/example_models/ExampleModel.fez) for this example." ] }, { "cell_type": "code", "execution_count": 1, "id": "efd68734", "metadata": { "execution": { "iopub.execute_input": "2026-03-19T15:26:12.511527Z", "iopub.status.busy": "2026-03-19T15:26:12.511175Z", "iopub.status.idle": "2026-03-19T15:26:30.514190Z", "shell.execute_reply": "2026-03-19T15:26:30.513064Z" }, "papermill": { "duration": 18.0078, "end_time": "2026-03-19T15:26:30.515675", "exception": false, "start_time": "2026-03-19T15:26:12.507875", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "28.0\n", "True\n", "0.2\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "{'BoltDiameter': 19.0, 'BoltModulusE': 250000.0, 'TensileCapacity': 0.2, 'ResidualTensileCapacity': 0.0, 'OutofPlaneSpacing': 1.2, 'PreTensioningForce': 0.0, 'ConstantPretensioningForceInInstallStage': True}\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "{'BoreholeDiameter': 48.0, 'CableDiameter': 19.0, 'CableModulusE': 200000.0, 'CablePeak': 0.1, 'OutofPlaneSpacing': 1.0, 'WaterCementRatio': 0.35, 'JointShear': True, 'FacePlates': True, 'AddPullOutForce': True, 'PullOutForce': 1.0, 'ConstantShearStiffness': False, 'Stiffness': 100.0, 'AddBulges': True, 'BulgeType': }\n", "[10.0, 20.0, 30.0]\n" ] } ], "source": [ "from rs2.modeler.RS2Modeler import RS2Modeler\n", "from rs2.modeler.properties.PropertyEnums import *\n", "import os\n", "\n", "current_dir = os.path.dirname(os.path.abspath(\"\")) \n", "\n", "RS2Modeler.startApplication(port=60054)\n", "modeler = RS2Modeler(port=60054)\n", "model = modeler.openFile(rf\"{current_dir}\\example_models\\ExampleModel.fez\")\n", "\n", "boltList = model.getAllBoltProperties()\n", "bolt1 = boltList[0]\n", "bolt2 = boltList[1]\n", "bolt3 = boltList[2]\n", "\n", "bolt1.setBoltName(\"Example Bolt 1\")\n", "bolt1.setBoltType(BoltTypes.FULLY_BONDED)\n", "bolt1.FullyBonded.setBoltDiameter(28)\n", "bolt1.FullyBonded.setJointShear(True)\n", "bolt1.FullyBonded.setPreTensioningForce(0.2)\n", "\n", "print(bolt1.FullyBonded.getBoltDiameter())\n", "print(bolt1.FullyBonded.getJointShear())\n", "print(bolt1.FullyBonded.getPreTensioningForce())\n", "\n", "bolt2.setBoltName(\"Example Bolt 2\")\n", "bolt2.setBoltType(BoltTypes.END_ANCHORED)\n", "bolt2.EndAnchored.setProperties(BoltModulusE=250000, OutofPlaneSpacing=1.2, TensileCapacity=0.2)\n", "\n", "print(bolt2.EndAnchored.getProperties())\n", "\n", "bolt3.setBoltName(\"Example Bolt 3\")\n", "bolt3.setBoltType(BoltTypes.PLAIN_STRAND_CABLE)\n", "bolt3.PlainStrandCable.setProperties(AddBulges=True, AddPullOutForce=True, PullOutForce=1)\n", "# Not all functions are accessible through the setProperties method. \n", "# Consult setProperties method definition in documentation to determine properties available.\n", "bolt3.PlainStrandCable.setBulgeLocations([10,20,30])\n", "\n", "print(bolt3.PlainStrandCable.getProperties())\n", "# Not all functions are accessible through the getProperties method. \n", "# Consult getProperties method definition in documentation to determine properties available.\n", "print(bolt3.PlainStrandCable.getBulgeLocations())\n", "\n", "model.close()\n", "modeler.closeProgram()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.0" }, "papermill": { "default_parameters": {}, "duration": 19.962527, "end_time": "2026-03-19T15:26:30.756586", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\bolt_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\bolt_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:26:10.794059", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }