Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Composite parts #99

Open
KelLynnP opened this issue Oct 5, 2024 · 0 comments
Open

Support for Composite parts #99

KelLynnP opened this issue Oct 5, 2024 · 0 comments

Comments

@KelLynnP
Copy link

KelLynnP commented Oct 5, 2024

Example here:

🟥 Assy w/ Composite Parts:
https://cad.onshape.com/documents/cacc96f8a7850b951e7aa69a/v/0b68bc480ee9159c974e6336/e/a3debca6b790e5cda599c3ae

🟥 Assy w/ Composite Parts:
https://cad.onshape.com/documents/cacc96f8a7850b951e7aa69a/v/0b68bc480ee9159c974e6336/e/d49d00bd4f2b6590cdfcf001

✅ Assy w/ Non Composite Parts:
https://cad.onshape.com/documents/cacc96f8a7850b951e7aa69a/v/0b68bc480ee9159c974e6336/e/6b28234cd16e8c5c8316bbbf

Full error:
INFO 2024-10-05 16:45:11 [httpx] HTTP Request: GET https://cad.onshape.com/api/assemblies/d/cacc96f8a7850b951e7aa69a/v/0b68bc480ee9159c974e6336/e/a3debca6b790e5cda599c3ae?includeMateFeatures=true&includeMateConnectors=true&includeNonSolids=true&configuration=default "HTTP/1.1 200 OK"
Traceback (most recent call last):
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/download.py", line 713, in check_document
assembly = await api.get_assembly(document_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/cached_api.py", line 74, in get_assembly
return await self.cacher(
^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/cacher.py", line 65, in call
item = await get_fn()
^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/api.py", line 115, in get_assembly
return Assembly.model_validate(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/pydantic/main.py", line 593, in model_validate
return cls.pydantic_validator.validate_python(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for Assembly
parts.0.bodyType
Input should be 'solid' [type=enum, input_value='composite', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/enum

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/opt/miniconda3/envs/onshape/bin/kol", line 8, in
sys.exit(sync_main())
^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/scripts/cli.py", line 39, in sync_main
asyncio.run(main())
File "/opt/miniconda3/envs/onshape/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/scripts/cli.py", line 27, in main
await download_and_postprocess_main(remaining_args)
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/postprocess.py", line 102, in download_and_postprocess_main
document_info = await download(
^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/download.py", line 1306, in download
checked_document = await check_document(document, api, config=config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/envs/onshape/lib/python3.11/site-packages/kol/onshape/download.py", line 715, in check_document
raise FailedCheckError(
kol.onshape.download.FailedCheckError: Failed to get assembly for document https://cad.onshape.com/documents/cacc96f8a7850b951e7aa69a/v/0b68bc480ee9159c974e6336/e/a3debca6b790e5cda599c3ae

Suggestions:

  • Check that the document is an assembly, not a part studio.

Original error:
1 validation error for Assembly
parts.0.bodyType
Input should be 'solid' [type=enum, input_value='composite', input_type=str]
For further information visit https://errors.pydantic.dev/2.9/v/enum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant