{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.001698, "end_time": "2026-03-19T15:27:19.634746", "exception": false, "start_time": "2026-03-19T15:27:19.633048", "status": "completed" }, "tags": [] }, "source": [ "(Pile Example)=\n", "# Pile Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001201, "end_time": "2026-03-19T15:27:19.637554", "exception": false, "start_time": "2026-03-19T15:27:19.636353", "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:27:19.641748Z", "iopub.status.busy": "2026-03-19T15:27:19.641413Z", "iopub.status.idle": "2026-03-19T15:27:35.134800Z", "shell.execute_reply": "2026-03-19T15:27:35.133218Z" }, "papermill": { "duration": 15.497278, "end_time": "2026-03-19T15:27:35.136235", "exception": false, "start_time": "2026-03-19T15:27:19.638957", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\GraceHu\\AppData\\Local\\Programs\\Python\\Python313\\Lib\\site-packages\\rs2\\_common\\documentProxy.py:5: UserWarning: Resetting the mesh. The operation you requested requires the piles to be rebuilt and the mesh to be reset.\n", " self._callFunction(\"rebuildAndPostProcessPiles\", [])\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", "RS2Modeler.startApplication(port=60081)\n", "modeler = RS2Modeler(port=60081)\n", "model = modeler.openFile(rf\"{current_dir}\\example_models\\ExampleModel.fez\")\n", "\n", "pile = model.getAllPileProperties()[0]\n", "\n", "pile.setPileName(\"MultiLinear Pile\")\n", "pile.setConnectionType(PileConnectionType.HINGED)\n", "pile.setLength(6)\n", "pile.setOutOfPlaneSpacing(0.6)\n", "\n", "pile.setSkinResistance(PileSkinResistanceType.MULTI_LINEAR)\n", "pile.MultiLinear.setShearStiffness(1001)\n", "\n", "pile.MultiLinear.setDefinitionMethod(PileDefinitionMethod.DISTANCE_FROM_TOP)\n", "pile.MultiLinear.setCoordinates([5,6,7],[10,11,12])\n", "\n", "pile.MultiLinear.setUseBaseResistance(False)\n", "\n", "pile.Beam.setApplication(PileApplicationType.DEFINE_BEAM_SEGMENT_BY_LENGTH)\n", "pile.Beam.defineBeamSegment([3,6], [\"Liner 4\", \"Liner 5\"])\n", "\n", "pile.ForceDisplacement.setApply(PileEndCondition.FORCE)\n", "pile.ForceDisplacement.setX(0.5)\n", "pile.ForceDisplacement.setY(0.6)\n", "\n", "model.close()\n", "\n", "modeler.closeProgram()" ] } ], "metadata": { "kernelspec": { "display_name": "myenv", "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": 17.052702, "end_time": "2026-03-19T15:27:35.384795", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\pile_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\pile_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:27:18.332093", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }