Skip to content

Commit 87b61d1

Browse files
committed
Update basic_usage.ipynb
1 parent 681a0f1 commit 87b61d1

File tree

1 file changed

+14
-101
lines changed

1 file changed

+14
-101
lines changed

examples/basic_usage.ipynb

Lines changed: 14 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": null,
66
"id": "d59622c6",
77
"metadata": {},
88
"outputs": [],
99
"source": [
10-
"import syside_license\n",
11-
"syside_license.check('key') # Validates your license\n",
1210
"from pprint import pprint\n",
1311
"\n",
1412
"from flexo_syside_lib.core import convert_sysml_file_textual_to_json, convert_sysml_string_textual_to_json, convert_json_to_sysml_textual\n",
@@ -27,21 +25,10 @@
2725
},
2826
{
2927
"cell_type": "code",
30-
"execution_count": 2,
28+
"execution_count": null,
3129
"id": "f6cb8c80",
3230
"metadata": {},
33-
"outputs": [
34-
{
35-
"data": {
36-
"text/plain": [
37-
"'tcs00001'"
38-
]
39-
},
40-
"execution_count": 2,
41-
"metadata": {},
42-
"output_type": "execute_result"
43-
}
44-
],
31+
"outputs": [],
4532
"source": [
4633
"ga.create_component(\n",
4734
" name=\"rootelement\",\n",
@@ -78,7 +65,7 @@
7865
},
7966
{
8067
"cell_type": "code",
81-
"execution_count": 3,
68+
"execution_count": null,
8269
"id": "56285449",
8370
"metadata": {},
8471
"outputs": [],
@@ -88,64 +75,10 @@
8875
},
8976
{
9077
"cell_type": "code",
91-
"execution_count": 4,
78+
"execution_count": null,
9279
"id": "d00b88d6",
9380
"metadata": {},
94-
"outputs": [
95-
{
96-
"name": "stdout",
97-
"output_type": "stream",
98-
"text": [
99-
"package MyStructure {\n",
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",
109-
" part def Component{\n",
110-
" attribute tx;\n",
111-
" attribute ty;\n",
112-
" attribute tz;\n",
113-
"\n",
114-
" attribute rx;\n",
115-
" attribute ry;\n",
116-
" attribute rz;\n",
117-
"\n",
118-
" attribute typeID;\n",
119-
" part children: Component[0..*];\n",
120-
" }\n",
121-
"\n",
122-
"\n",
123-
" part def Context {\n",
124-
" part rootelement :Component {\n",
125-
" part nx00001: Onshape_Component, Omniverse_Component subsets children {\n",
126-
" attribute :>> tx=1.0;\n",
127-
" attribute :>> ty=1.0;\n",
128-
" attribute :>> tz=1.0;\n",
129-
" attribute :>> rx=1.0;\n",
130-
" attribute :>> ry=1.0;\n",
131-
" attribute :>> rz=1.0;\n",
132-
" attribute :>> typeID = 0;\n",
133-
" part tcs00001: Onshape_Component, Omniverse_Component subsets children {\n",
134-
" attribute :>> tx=1.0;\n",
135-
" attribute :>> ty=1.0;\n",
136-
" attribute :>> tz=1.0;\n",
137-
" attribute :>> rx=1.0;\n",
138-
" attribute :>> ry=1.0;\n",
139-
" attribute :>> rz=1.0;\n",
140-
" attribute :>> typeID = 2;\n",
141-
" }\n",
142-
" }\n",
143-
" }\n",
144-
" }\n",
145-
"}\n"
146-
]
147-
}
148-
],
81+
"outputs": [],
14982
"source": [
15083
"print (sysml_text)"
15184
]
@@ -160,21 +93,13 @@
16093
},
16194
{
16295
"cell_type": "code",
163-
"execution_count": 5,
96+
"execution_count": null,
16497
"id": "5bfc772f",
16598
"metadata": {},
166-
"outputs": [
167-
{
168-
"name": "stdout",
169-
"output_type": "stream",
170-
"text": [
171-
"Client initialized successfully!\n"
172-
]
173-
}
174-
],
99+
"outputs": [],
175100
"source": [
176101
"#flexo config\n",
177-
"BASE_URL = \"http://192.168.1.214:31083/\" \n",
102+
"BASE_URL = \"URL\" \n",
178103
"\n",
179104
"BEARER_TOKEN = \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJmbGV4by1tbXMtYXVkaWVuY2UiLCJpc3MiOiJodHRwOi8vZmxleG8tbW1zLXNlcnZpY2VzIiwidXNlcm5hbWUiOiJ1c2VyMDEiLCJncm91cHMiOlsic3VwZXJfYWRtaW5zIl0sImV4cCI6MTc2OTY3MzYwMH0.UqU5KOPSCbYyqbj3BBZs4u7lWbpHyDHPEd7Tbd4wWsM\"\n",
180105
"\n",
@@ -203,7 +128,7 @@
203128
},
204129
{
205130
"cell_type": "code",
206-
"execution_count": 2,
131+
"execution_count": null,
207132
"id": "46aa4508",
208133
"metadata": {},
209134
"outputs": [],
@@ -213,22 +138,10 @@
213138
},
214139
{
215140
"cell_type": "code",
216-
"execution_count": 11,
141+
"execution_count": null,
217142
"id": "6b1870b8",
218143
"metadata": {},
219-
"outputs": [
220-
{
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)"
229-
]
230-
}
231-
],
144+
"outputs": [],
232145
"source": [
233146
"# example_mypattern_components.py\n",
234147
"import json\n",
@@ -312,7 +225,7 @@
312225
],
313226
"metadata": {
314227
"kernelspec": {
315-
"display_name": ".venv",
228+
"display_name": ".venv (3.13.2)",
316229
"language": "python",
317230
"name": "python3"
318231
},
@@ -326,7 +239,7 @@
326239
"name": "python",
327240
"nbconvert_exporter": "python",
328241
"pygments_lexer": "ipython3",
329-
"version": "3.13.7"
242+
"version": "3.13.2"
330243
}
331244
},
332245
"nbformat": 4,

0 commit comments

Comments
 (0)