SuperAPI AI Directory

solidworks-threaded-holes

Design & creation

View repository

Updated 10-16 08:54

About this skill

SolidWorks Threaded Holes

First determine the capability level

The current stable script is scripts/create_threaded_hole_template.py, which generates ISO metric internal thread holes on a newly created rectangular sample part.

  • verified: M3/M4/M5/M6/M8/M10/M12 coarse internal threads, blind holes or true Through All tap drill holes, hole mouth chamfers, right-hand/left-hand threads, tolerance attributes, real Metric Tap Thread features, STEP and review evidence. Blind holes and through holes have been tested in SolidWorks 2026.
  • reviewed: ISO metric specifications outside the table; the user must explicitly provide --tap-drill, and the tap drill must not be guessed.
  • pilot: Positioning and modifying holes on existing parts, Hole Wizard/Advanced Hole, external threads, inch/UN/UNF/NPT/BSP, multi-start threads, explicit thread profiles and drill points/relief grooves. Before execution, read Extended roadmap。

Stable workflow

  1. Run from the repository root python scripts/sw_preflight.py。
  2. Confirm the thread specification, internal/external thread, tolerance grade, handedness, blind/through, thread depth, tap drill depth, hole position, and whether a real thread profile is required.
  3. Before COM, validate that all values are finite numbers, the tap drill is smaller than the nominal diameter, the thread depth does not exceed the tap drill/part thickness, and the hole position preserves the thread major diameter and chamfer boundary.
  4. First create the real tap drill geometry: for blind holes use swEndCondBlind=0, and for through holes you must use swEndCondThroughAll=1, and must not disguise it as a blind hole with "plate thickness + 1 mm".
  5. Enumerate circular edges by circle center, radius, and entry face, without relying on Edge1 or screen coordinates.
  6. Try a real Thread:Type="Metric Tap", use selection mark for planar circular edges 1, do not write the same circular edge into StartEntity, do not call a nonexistent LoadReferences, and do not overwrite the tap drill cylinder diameter with the nominal diameter.
  7. When Thread fails, try InsertCosmeticThread3; for through cosmetic threads use swEndConditionThrough=2. A non-null COM return does not mean persistence succeeded; you must rebuild and traverse the feature tree.
  8. Only when neither a real nor a cosmetic thread remains in the feature tree,--visible-thread fallback create a 3D sketch helix. The helix may use fractional turns to preserve the true pitch; export separately *_thread_evidence.bmp then hide the sketch to avoid polluting the standard preview.
  9. Create the hole mouth chamfer, and write the thread specification, tap drill, depth, tolerance, handedness, end condition, and final representation status.
  10. Hide reference planes, save the SLDPRT, export STEP, run sw_review.run_review(), and visually inspect the isometric/three views.

Template usage

Default M6×1 right-hand 6H blind hole:

python subskills/solidworks-threaded-holes/scripts/create_threaded_hole_template.py `
  --thread M6 `
  --output-dir C:\CADAutomationWorkbench\solidworks_threaded_hole_output

M8×1 off-table fine pitch, left-hand, through hole:

python subskills/solidworks-threaded-holes/scripts/create_threaded_hole_template.py `
  --thread M8x1 `
  --tap-drill 7.0 `
  --through `
  --handedness left `
  --thread-class 6H `
  --output-dir C:\CADAutomationWorkbench\m8x1_lh_output

--visible-thread supports fallback(default),always and never. For normal delivery keep fallback; only use when debugging the helix always。

Delivery and verification

Must generate:

  • *.SLDPRT
  • *.step
  • *_parameters.json
  • *_review_report.json
  • *_isometric.bmp and three views
  • Generate only when creating a visible helix *_thread_evidence.bmp

*_parameters.json must simultaneously check thread_attempts、thread_evidence and thread_status. Delivery is allowed only when all of the following conditions are met:

  • has_tap_drill_cut=true and has_mouth_chamfer=true。
  • representation is real-thread、cosmetic-thread or an explainable visible-helix;metadata-only must block template delivery.
  • review's expected_outputs_exist and previews_not_blank for true。
  • The standard preview does not show reference planes, no dashed 3D sketch lines penetrating solids appear, and hole positions and chamfers are correct.

For detailed measured interfaces, fault causes, and official documentation links, see Threaded Hole Measurement Experience; for unimplemented capabilities and acceptance thresholds, see Extended Roadmap。