{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.001943, "end_time": "2026-03-19T15:27:37.179266", "exception": false, "start_time": "2026-03-19T15:27:37.177323", "status": "completed" }, "tags": [] }, "source": [ "(Structural Interface Example)=\n", "# Structural Interface Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001277, "end_time": "2026-03-19T15:27:37.182154", "exception": false, "start_time": "2026-03-19T15:27:37.180877", "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:37.186634Z", "iopub.status.busy": "2026-03-19T15:27:37.186254Z", "iopub.status.idle": "2026-03-19T15:27:47.809540Z", "shell.execute_reply": "2026-03-19T15:27:47.807946Z" }, "papermill": { "duration": 10.627786, "end_time": "2026-03-19T15:27:47.811230", "exception": false, "start_time": "2026-03-19T15:27:37.183444", "status": "completed" }, "tags": [] }, "outputs": [], "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=60084)\n", "modeler = RS2Modeler(port=60084)\n", "model = modeler.openFile(rf\"{current_dir}\\example_models\\ExampleModel.fez\")\n", "\n", "structural = model.getAllStructuralInterfaceProperties()[0]\n", "\n", "structural.setStructuralInterfaceName(\"Example Structural 1\")\n", "structural.setPositiveJointPropertyByName(\"Joint 3\")\n", "structural.setLinerPropertyByName(\"Liner 4\")\n", "structural.setNegativeJointPropertyByName(\"Joint 5\")\n", "\n", "model.close()\n", "\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": 12.776, "end_time": "2026-03-19T15:27:48.166904", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\structural_interface_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\support\\structural_interface_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:27:35.390904", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }