Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 14 additions & 101 deletions examples/basic_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "d59622c6",
"metadata": {},
"outputs": [],
"source": [
"import syside_license\n",
"syside_license.check('key') # Validates your license\n",
"from pprint import pprint\n",
"\n",
"from flexo_syside_lib.core import convert_sysml_file_textual_to_json, convert_sysml_string_textual_to_json, convert_json_to_sysml_textual\n",
Expand All @@ -27,21 +25,10 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "f6cb8c80",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'tcs00001'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"ga.create_component(\n",
" name=\"rootelement\",\n",
Expand Down Expand Up @@ -78,7 +65,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "56285449",
"metadata": {},
"outputs": [],
Expand All @@ -88,64 +75,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "d00b88d6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"package MyStructure {\n",
"\n",
"\n",
" part def Onshape_Component {\n",
" attribute onshape_url;\n",
" }\n",
" part def Omniverse_Component {\n",
" attribute ov_filepath;\n",
" }\n",
"\n",
" part def Component{\n",
" attribute tx;\n",
" attribute ty;\n",
" attribute tz;\n",
"\n",
" attribute rx;\n",
" attribute ry;\n",
" attribute rz;\n",
"\n",
" attribute typeID;\n",
" part children: Component[0..*];\n",
" }\n",
"\n",
"\n",
" part def Context {\n",
" part rootelement :Component {\n",
" part nx00001: Onshape_Component, Omniverse_Component subsets children {\n",
" attribute :>> tx=1.0;\n",
" attribute :>> ty=1.0;\n",
" attribute :>> tz=1.0;\n",
" attribute :>> rx=1.0;\n",
" attribute :>> ry=1.0;\n",
" attribute :>> rz=1.0;\n",
" attribute :>> typeID = 0;\n",
" part tcs00001: Onshape_Component, Omniverse_Component subsets children {\n",
" attribute :>> tx=1.0;\n",
" attribute :>> ty=1.0;\n",
" attribute :>> tz=1.0;\n",
" attribute :>> rx=1.0;\n",
" attribute :>> ry=1.0;\n",
" attribute :>> rz=1.0;\n",
" attribute :>> typeID = 2;\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n"
]
}
],
"outputs": [],
"source": [
"print (sysml_text)"
]
Expand All @@ -160,21 +93,13 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "5bfc772f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Client initialized successfully!\n"
]
}
],
"outputs": [],
"source": [
"#flexo config\n",
"BASE_URL = \"http://192.168.1.214:31083/\" \n",
"BASE_URL = \"URL\" \n",
"\n",
"BEARER_TOKEN = \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJmbGV4by1tbXMtYXVkaWVuY2UiLCJpc3MiOiJodHRwOi8vZmxleG8tbW1zLXNlcnZpY2VzIiwidXNlcm5hbWUiOiJ1c2VyMDEiLCJncm91cHMiOlsic3VwZXJfYWRtaW5zIl0sImV4cCI6MTc2OTY3MzYwMH0.UqU5KOPSCbYyqbj3BBZs4u7lWbpHyDHPEd7Tbd4wWsM\"\n",
"\n",
Expand Down Expand Up @@ -203,7 +128,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "46aa4508",
"metadata": {},
"outputs": [],
Expand All @@ -213,22 +138,10 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "6b1870b8",
"metadata": {},
"outputs": [
{
"ename": "ImportError",
"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)",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mImportError\u001b[39m Traceback (most recent call last)",
"\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",
"\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)"
]
}
],
"outputs": [],
"source": [
"# example_mypattern_components.py\n",
"import json\n",
Expand Down Expand Up @@ -312,7 +225,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": ".venv (3.13.2)",
"language": "python",
"name": "python3"
},
Expand All @@ -326,7 +239,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.7"
"version": "3.13.2"
}
},
"nbformat": 4,
Expand Down
Loading