{ "cells": [ { "cell_type": "markdown", "id": "018cc166", "metadata": {}, "source": [ "# Modeling: Visualization of the design tree on terminal\n", "\n", "A user can visualize its model object tree easily by using the ``tree_print()`` method\n", "available on the ``Design`` and ``Component`` objects. This method prints the tree\n", "structure of the model in the terminal.\n", "\n", "## Perform required imports\n", "\n", "For the following example, we need to import these modules:" ] }, { "cell_type": "code", "execution_count": 1, "id": "b28d13fc", "metadata": { "execution": { "iopub.execute_input": "2024-09-11T12:29:50.732690Z", "iopub.status.busy": "2024-09-11T12:29:50.732690Z", "iopub.status.idle": "2024-09-11T12:29:53.041676Z", "shell.execute_reply": "2024-09-11T12:29:53.041676Z" } }, "outputs": [], "source": [ "from pint import Quantity\n", "\n", "from ansys.geometry.core import launch_modeler\n", "from ansys.geometry.core.math.constants import UNITVECTOR3D_X, UNITVECTOR3D_Y\n", "from ansys.geometry.core.math.point import Point2D, Point3D\n", "from ansys.geometry.core.misc.units import UNITS\n", "from ansys.geometry.core.sketch.sketch import Sketch" ] }, { "cell_type": "markdown", "id": "7d37797b", "metadata": {}, "source": [ "## Create a design\n", "\n", "The following code creates a simple design for demonstration purposes. The design consists of\n", "several cylinders extruded. The interesting part is visualizing the corresponding design tree." ] }, { "cell_type": "code", "execution_count": 2, "id": "662c3475", "metadata": { "execution": { "iopub.execute_input": "2024-09-11T12:29:53.041676Z", "iopub.status.busy": "2024-09-11T12:29:53.041676Z", "iopub.status.idle": "2024-09-11T12:29:56.003137Z", "shell.execute_reply": "2024-09-11T12:29:56.003137Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "015818fc79874a0f92dbae2e9ad118ba", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "780200bdef0647fe89ac8d79403d5200": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "ff41243cf2ce42c8a697b8cac2d4bf1a": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }