{ "cells": [ { "cell_type": "markdown", "id": "27f5c2ed", "metadata": {}, "source": [ "# Modeling: Design organization\n", "\n", "The ``Design`` instance creates a design project within the remote Geometry service to\n", "complete all CAD modeling against.\n", "\n", "You can organize all solid and surface bodies in each design within a customizable\n", "component hierarchy. A component is simply an organization mechanism.\n", "\n", "The top-level design node and each child component node can have one or more bodies assigned\n", "and one or more components assigned.\n", "\n", "The API requires each component of the design hierarchy to be given a user-defined name.\n", "\n", "There are several design operations that result in a body being created within a design.\n", "Executing each of these methods against a specific component instance explicitly specifies the\n", "node of the design tree to place the new body under." ] }, { "cell_type": "markdown", "id": "85b74e2b", "metadata": {}, "source": [ "## Perform required imports\n", "\n", "Perform the required imports." ] }, { "cell_type": "code", "execution_count": 1, "id": "db99e312", "metadata": { "execution": { "iopub.execute_input": "2025-01-16T08:16:54.581628Z", "iopub.status.busy": "2025-01-16T08:16:54.579593Z", "iopub.status.idle": "2025-01-16T08:16:58.956270Z", "shell.execute_reply": "2025-01-16T08:16:58.956270Z" } }, "outputs": [], "source": [ "from ansys.geometry.core import launch_modeler\n", "from ansys.geometry.core.math import UNITVECTOR3D_X, Point2D\n", "from ansys.geometry.core.misc import UNITS, Distance\n", "from ansys.geometry.core.sketch import Sketch" ] }, { "cell_type": "markdown", "id": "94da9c3f", "metadata": {}, "source": [ "## Organize design\n", "\n", "Extrude two sketches to create bodies. Assign the cylinder to the\n", "top-level design component. Assign the slot to the component nested\n", "one level beneath the top-level design component." ] }, { "cell_type": "code", "execution_count": 2, "id": "4f00d33a", "metadata": { "execution": { "iopub.execute_input": "2025-01-16T08:16:58.962373Z", "iopub.status.busy": "2025-01-16T08:16:58.960341Z", "iopub.status.idle": "2025-01-16T08:17:03.143582Z", "shell.execute_reply": "2025-01-16T08:17:03.141552Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ee7798adc8384991af33fcd650904e71", "version_major": 2, "version_minor": 0 }, "text/plain": [ "EmbeddableWidget(value='" } }, "8597323931d74fddaf1a64a146cb9369": { "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 } }, "b8695c12dd634f2b8c3bf798525602f1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_14ce2931decf4628b8f4f7d7ed45bbd8", "placeholder": "​", "style": "IPY_MODEL_d017dd9e3939412abfdf3f01508c62d2", "value": "" } }, "c0786c631b2244f88ff0496d7b9f42a3": { "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": "" } }, "d017dd9e3939412abfdf3f01508c62d2": { "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": "" } }, "d8548187285c4ae888b85a497e452e61": { "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": "" } }, "ee7798adc8384991af33fcd650904e71": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_31e27a432c1f417b992c0b7e302d749d", "placeholder": "​", "style": "IPY_MODEL_d8548187285c4ae888b85a497e452e61", "value": "" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }