{ "cells": [ { "cell_type": "markdown", "id": "aececd27", "metadata": { "papermill": { "duration": 0.002168, "end_time": "2026-03-19T15:22:00.068274", "exception": false, "start_time": "2026-03-19T15:22:00.066106", "status": "completed" }, "tags": [] }, "source": [ "(Modeler Example)=\n", "# Modeler Script Examples" ] }, { "cell_type": "markdown", "id": "8f03602b", "metadata": { "papermill": { "duration": 0.001296, "end_time": "2026-03-19T15:22:00.071370", "exception": false, "start_time": "2026-03-19T15:22:00.070074", "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:22:00.076092Z", "iopub.status.busy": "2026-03-19T15:22:00.075773Z", "iopub.status.idle": "2026-03-19T15:22:10.128570Z", "shell.execute_reply": "2026-03-19T15:22:10.126002Z" }, "papermill": { "duration": 10.058325, "end_time": "2026-03-19T15:22:10.131113", "exception": false, "start_time": "2026-03-19T15:22:00.072788", "status": "completed" }, "tags": [] }, "outputs": [], "source": [ "from rs2.modeler.RS2Modeler import RS2Modeler\n", "import os\n", "\n", "current_dir = os.path.dirname(os.path.abspath(\"\")) \n", "RS2Modeler.startApplication(port=60076)\n", "modeler = RS2Modeler(port=60076)\n", "model = modeler.openFile(rf\"{current_dir}\\example_models\\ExampleModel.fez\")\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": 11.716656, "end_time": "2026-03-19T15:22:10.479780", "environment_variables": {}, "exception": null, "input_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\model\\modeler_script_examples.ipynb", "output_path": "C:\\Users\\GraceHu\\source\\repos\\RS2_Python_Client_Library\\docs\\example_code\\model\\modeler_script_examples.ipynb", "parameters": {}, "start_time": "2026-03-19T15:21:58.763124", "version": "2.6.0" } }, "nbformat": 4, "nbformat_minor": 5 }