{ "cells": [ { "cell_type": "markdown", "id": "ffc0f087", "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": "123d5e56", "metadata": { "execution": { "iopub.execute_input": "2024-10-08T08:39:51.862365Z", "iopub.status.busy": "2024-10-08T08:39:51.862365Z", "iopub.status.idle": "2024-10-08T08:39:55.557380Z", "shell.execute_reply": "2024-10-08T08:39:55.557380Z" } }, "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": "9ec5db88", "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": "eb3f3995", "metadata": { "execution": { "iopub.execute_input": "2024-10-08T08:39:55.557380Z", "iopub.status.busy": "2024-10-08T08:39:55.557380Z", "iopub.status.idle": "2024-10-08T08:39:59.759852Z", "shell.execute_reply": "2024-10-08T08:39:59.759852Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "40024c6e1bd24edc8c25a3e9b6c6814b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }