|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "code", |
5 | | - "execution_count": null, |
| 5 | + "execution_count": 1, |
6 | 6 | "id": "d59622c6", |
7 | 7 | "metadata": {}, |
8 | 8 | "outputs": [], |
|
27 | 27 | }, |
28 | 28 | { |
29 | 29 | "cell_type": "code", |
30 | | - "execution_count": 3, |
| 30 | + "execution_count": 2, |
31 | 31 | "id": "f6cb8c80", |
32 | 32 | "metadata": {}, |
33 | 33 | "outputs": [ |
|
37 | 37 | "'tcs00001'" |
38 | 38 | ] |
39 | 39 | }, |
40 | | - "execution_count": 3, |
| 40 | + "execution_count": 2, |
41 | 41 | "metadata": {}, |
42 | 42 | "output_type": "execute_result" |
43 | 43 | } |
|
78 | 78 | }, |
79 | 79 | { |
80 | 80 | "cell_type": "code", |
81 | | - "execution_count": 4, |
| 81 | + "execution_count": 3, |
82 | 82 | "id": "56285449", |
83 | 83 | "metadata": {}, |
84 | 84 | "outputs": [], |
|
88 | 88 | }, |
89 | 89 | { |
90 | 90 | "cell_type": "code", |
91 | | - "execution_count": 5, |
| 91 | + "execution_count": 4, |
92 | 92 | "id": "d00b88d6", |
93 | 93 | "metadata": {}, |
94 | 94 | "outputs": [ |
|
98 | 98 | "text": [ |
99 | 99 | "package MyStructure {\n", |
100 | 100 | "\n", |
| 101 | + "\n", |
| 102 | + " part def Onshape_Component {\n", |
| 103 | + " attribute onshape_url;\n", |
| 104 | + " }\n", |
| 105 | + " part def Omniverse_Component {\n", |
| 106 | + " attribute ov_filepath;\n", |
| 107 | + " }\n", |
| 108 | + "\n", |
101 | 109 | " part def Component{\n", |
102 | 110 | " attribute tx;\n", |
103 | 111 | " attribute ty;\n", |
|
114 | 122 | "\n", |
115 | 123 | " part def Context {\n", |
116 | 124 | " part rootelement :Component {\n", |
117 | | - " part nx00001 subsets children {\n", |
| 125 | + " part nx00001: Onshape_Component, Omniverse_Component subsets children {\n", |
118 | 126 | " attribute :>> tx=1.0;\n", |
119 | 127 | " attribute :>> ty=1.0;\n", |
120 | 128 | " attribute :>> tz=1.0;\n", |
121 | 129 | " attribute :>> rx=1.0;\n", |
122 | 130 | " attribute :>> ry=1.0;\n", |
123 | 131 | " attribute :>> rz=1.0;\n", |
124 | 132 | " attribute :>> typeID = 0;\n", |
125 | | - " part tcs00001 subsets children {\n", |
| 133 | + " part tcs00001: Onshape_Component, Omniverse_Component subsets children {\n", |
126 | 134 | " attribute :>> tx=1.0;\n", |
127 | 135 | " attribute :>> ty=1.0;\n", |
128 | 136 | " attribute :>> tz=1.0;\n", |
|
152 | 160 | }, |
153 | 161 | { |
154 | 162 | "cell_type": "code", |
155 | | - "execution_count": null, |
| 163 | + "execution_count": 5, |
156 | 164 | "id": "5bfc772f", |
157 | 165 | "metadata": {}, |
158 | 166 | "outputs": [ |
|
166 | 174 | ], |
167 | 175 | "source": [ |
168 | 176 | "#flexo config\n", |
169 | | - "BASE_URL = \"URL\" \n", |
| 177 | + "BASE_URL = \"http://192.168.1.214:31083/\" \n", |
170 | 178 | "\n", |
171 | 179 | "BEARER_TOKEN = \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJmbGV4by1tbXMtYXVkaWVuY2UiLCJpc3MiOiJodHRwOi8vZmxleG8tbW1zLXNlcnZpY2VzIiwidXNlcm5hbWUiOiJ1c2VyMDEiLCJncm91cHMiOlsic3VwZXJfYWRtaW5zIl0sImV4cCI6MTc2OTY3MzYwMH0.UqU5KOPSCbYyqbj3BBZs4u7lWbpHyDHPEd7Tbd4wWsM\"\n", |
172 | 180 | "\n", |
|
187 | 195 | "metadata": {}, |
188 | 196 | "outputs": [], |
189 | 197 | "source": [ |
190 | | - "project, proj_id = v2.get_project_by_name(client, name = \"myproject\")\n", |
191 | | - "created_project, example_project_id, _ = v2.create_sysml_project(client, name=\"myproject\")\n", |
| 198 | + "project, proj_id = v2.get_project_by_name(client, name = \"Flexo_SysIDE_TestProject\")\n", |
| 199 | + "created_project, example_project_id, _ = v2.create_sysml_project(client, name=\"Flexo_SysIDE_TestProject\")\n", |
192 | 200 | "change_payload_str = convert_sysml_string_textual_to_json(sysml_text, minimal=False)\n", |
193 | 201 | "commit1_response, commit1_id = v2.commit_to_project(client, example_project_id, change_payload_str, commit_msg = \"default commit message\")" |
194 | 202 | ] |
|
205 | 213 | }, |
206 | 214 | { |
207 | 215 | "cell_type": "code", |
208 | | - "execution_count": null, |
| 216 | + "execution_count": 11, |
209 | 217 | "id": "6b1870b8", |
210 | 218 | "metadata": {}, |
211 | 219 | "outputs": [ |
212 | 220 | { |
213 | | - "name": "stdout", |
214 | | - "output_type": "stream", |
215 | | - "text": [ |
216 | | - "Walking the ownership tree printing all elements:\n", |
217 | | - "[{'abs_rx': 1.0,\n", |
218 | | - " 'abs_ry': 1.0,\n", |
219 | | - " 'abs_rz': 1.0,\n", |
220 | | - " 'abs_tx': 1.0,\n", |
221 | | - " 'abs_ty': 1.0,\n", |
222 | | - " 'abs_tz': 1.0,\n", |
223 | | - " 'name': 'nx00001',\n", |
224 | | - " 'parent_name': None,\n", |
225 | | - " 'parent_typeID': None,\n", |
226 | | - " 'rx': 1.0,\n", |
227 | | - " 'ry': 1.0,\n", |
228 | | - " 'rz': 1.0,\n", |
229 | | - " 'tx': 1.0,\n", |
230 | | - " 'ty': 1.0,\n", |
231 | | - " 'typeID': 1000.0,\n", |
232 | | - " 'tz': 1.0},\n", |
233 | | - " {'abs_rx': 2.469355406085109,\n", |
234 | | - " 'abs_ry': 0.28857876165748914,\n", |
235 | | - " 'abs_rz': 2.469355406085109,\n", |
236 | | - " 'abs_tx': 2.1735727354212466,\n", |
237 | | - " 'abs_ty': 2.2703235189345308,\n", |
238 | | - " 'abs_tz': 0.9051043103313733,\n", |
239 | | - " 'name': 'tcs00001',\n", |
240 | | - " 'parent_name': 'nx00001',\n", |
241 | | - " 'parent_typeID': 1000.0,\n", |
242 | | - " 'rx': 1.0,\n", |
243 | | - " 'ry': 1.0,\n", |
244 | | - " 'rz': 1.0,\n", |
245 | | - " 'tx': 1.0,\n", |
246 | | - " 'ty': 1.0,\n", |
247 | | - " 'typeID': 2.0,\n", |
248 | | - " 'tz': 1.0}]\n" |
| 221 | + "ename": "ImportError", |
| 222 | + "evalue": "cannot import name 'find_part_with_components' from 'geometry_api.geometry_api' (/Users/johannes/sysmlv2_dls/.venv/lib/python3.13/site-packages/geometry_api/geometry_api.py)", |
| 223 | + "output_type": "error", |
| 224 | + "traceback": [ |
| 225 | + "\u001b[31m---------------------------------------------------------------------------\u001b[39m", |
| 226 | + "\u001b[31mImportError\u001b[39m Traceback (most recent call last)", |
| 227 | + "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[11]\u001b[39m\u001b[32m, line 5\u001b[39m\n\u001b[32m 3\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mpprint\u001b[39;00m\n\u001b[32m 4\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mtransformation_api\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mtransformations\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m transformation_matrix, euler_from_matrix\n\u001b[32m----> \u001b[39m\u001b[32m5\u001b[39m \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01mgeometry_api\u001b[39;00m\u001b[34;01m.\u001b[39;00m\u001b[34;01mgeometry_api\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;28;01mimport\u001b[39;00m components_from_part_world, find_part_with_components, walk_ownership_tree, find_part_by_name\n\u001b[32m 7\u001b[39m \u001b[38;5;66;03m# If needed to import your transformations file:\u001b[39;00m\n\u001b[32m 8\u001b[39m \u001b[38;5;28;01mimport\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01msyside\u001b[39;00m\n", |
| 228 | + "\u001b[31mImportError\u001b[39m: cannot import name 'find_part_with_components' from 'geometry_api.geometry_api' (/Users/johannes/sysmlv2_dls/.venv/lib/python3.13/site-packages/geometry_api/geometry_api.py)" |
249 | 229 | ] |
250 | 230 | } |
251 | 231 | ], |
252 | 232 | "source": [ |
253 | 233 | "# example_mypattern_components.py\n", |
254 | 234 | "import json\n", |
255 | 235 | "import pprint\n", |
256 | | - "from geometry_api.transformations import transformation_matrix, euler_from_matrix\n", |
| 236 | + "from transformation_api.transformations import transformation_matrix, euler_from_matrix\n", |
257 | 237 | "from geometry_api.geometry_api import components_from_part_world, find_part_with_components, walk_ownership_tree, find_part_by_name\n", |
258 | 238 | "\n", |
259 | 239 | "# If needed to import your transformations file:\n", |
|
332 | 312 | ], |
333 | 313 | "metadata": { |
334 | 314 | "kernelspec": { |
335 | | - "display_name": ".venv (3.13.2)", |
| 315 | + "display_name": ".venv", |
336 | 316 | "language": "python", |
337 | 317 | "name": "python3" |
338 | 318 | }, |
|
346 | 326 | "name": "python", |
347 | 327 | "nbconvert_exporter": "python", |
348 | 328 | "pygments_lexer": "ipython3", |
349 | | - "version": "3.13.2" |
| 329 | + "version": "3.13.7" |
350 | 330 | } |
351 | 331 | }, |
352 | 332 | "nbformat": 4, |
|
0 commit comments