Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Problem / motivation
create_sweep and create_loft in src/solidworks_mcp/adapters/pywin32_adapter.py currently return an error immediately without attempting any COM call:
# pywin32_adapter.py ~L1052
return AdapterResult(
status=AdapterResultStatus.ERROR,
error="Sweep feature not implemented in basic pywin32 adapter",
)Sweep and loft are common SolidWorks features used in mechanical parts (helical springs, airfoils, bottles, transition fittings). Without them, the MCP server cannot execute many reconstruction or design workflows. They are tracked in SWChecklist.md backlog and referenced in the feature-tree reconstruction skill.
Proposed solution
Files to change
src/solidworks_mcp/adapters/pywin32_adapter.py— replace the stub bodies with real COM calls- nearest test file in
tests/— add branch-coverage tests for both operations src/solidworks_mcp/adapters/mock_adapter.py— return a sensible stubSolidWorksFeature
Parameters already defined in base.py
class SweepParameters(BaseModel):
path: str # named sketch / edge for the sweep path
twist_along_path: bool = False
twist_angle: float = 0.0
merge_result: bool = True
class LoftParameters(BaseModel):
profiles: list[str] # ordered list of section sketch names
guide_curves: list[str] | None = None
start_tangent: str | None = None
end_tangent: str | None = None
merge_result: bool = TrueCOM API references
- Sweep:
IFeatureManager::InsertProtrusionSweep2— requires active profile sketch + named path - Loft:
IFeatureManager::InsertProtrusionBlend2— accepts an array of profile sketch names; guide curves passed via direct param array
Reference implementation pattern
Follow create_revolve (L964 in pywin32_adapter.py) which:
- Guards on
self.currentModel - Defines an inner
_operation()closure - Calls
featureManager = self.currentModel.FeatureManager - Wraps in
self._handle_com_operation(name, closure) - Returns a
SolidWorksFeaturedataclass on success
Acceptance criteria
-
create_sweepreturnsAdapterResultStatus.SUCCESSand aSolidWorksFeaturewhen a valid profile sketch + path are active -
create_loftreturnsAdapterResultStatus.SUCCESSwith >= 2 profiles - Both return
ERRORwith a descriptive message whencurrentModelisNone - Mock adapter returns a stub
SolidWorksFeature(not an error) for both - Unit tests cover: no-model guard, success path, and parameter edge cases
-
dev-test(non-solidworks_only) passes
Out of scope
- Thin-wall sweep/loft variants
- Swept/lofted cut operations (separate issue)
- Sheet metal sweep
References
src/solidworks_mcp/adapters/pywin32_adapter.pyL964 (create_revolvereference)src/solidworks_mcp/adapters/base.pyL250–L284 (parameter schemas)docs/planning/ROADMAP_2026_2027.mdQ2 2026 Foundation phase- SolidWorks API:
IFeatureManager::InsertProtrusionSweep2,InsertProtrusionBlend2
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
docs(planning): align harmonic-analyzer plan with open upstream issues
docs(planning): align harmonic-analyzer plan with open upstream issues
feat(adapter): Phase 1 — implement sweep and loft COM operations
feat(adapter): Phase 1 — implement sweep and loft COM operations
Phase 1 — sweep & loft COM operations (closes #2) (#25)
feat(adapter): Phase 1 — implement sweep and loft COM operations
Merge pull request #33 from pedropaulovc/feat/sweep-loft-com-operations
feat(adapter): Phase 1 — implement sweep and loft COM operations
Merge pull request andrewbartels1#33 from pedropaulovc/feat/sweep-lof…