You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(tools): save_body_as_part opens a linked assembly and leaves it open #101
After a successful save_body_as_part call, an extra Assem<N> document is
open in SolidWorks (unsaved, no path). Reproduced live during the PR #99
tutorial run — list_open_documents afterwards showed the source part plus an Assem14 that the tool never mentions.
Cause
IFeatureManager::CreateSaveBodyFeature in src/solidworks_mcp/adapters/solidworks/io.pysave_body_as_part is called
as:
SolidWorks' Save Bodies feature has a "Create assembly" option that is on by
default; one of the trailing args (or the empty AssemblyName being treated as
"auto") is triggering assembly creation. The standalone .sldprt is still
written correctly — this is just an unwanted side document.
Impact
Low — the file write (the tool's actual contract) works and is verified. But
the stray assembly:
pollutes list_open_documents
can confuse close_model (which acts on the active doc) in a cleanup loop
is surprising: the tool's docstring says nothing about an assembly
Fix
Confirm the exact CreateSaveBodyFeature signature against sldworks.tlb on
the target install, pass the arg combination that suppresses assembly
creation, and if an assembly is unavoidable, either close it in the tool or
document it and return its name in the response.
Still reproduces on main (600624f), SW R2026x. After save_body_as_part on a single-body box, list_open_documents shows the source part plus two extra docs: the extracted body.SLDPRT (left open) and an unsaved Assem4 (active). The fix should close both, or not open them, and leave the source part active.
Activity
andrewbartels1 commentedon Oct 13, 2026
Still reproduces on main (600624f), SW R2026x. After
save_body_as_parton a single-body box,list_open_documentsshows the source part plus two extra docs: the extractedbody.SLDPRT(left open) and an unsavedAssem4(active). The fix should close both, or not open them, and leave the source part active.