10.010.017.0
Loading the interactive model…
Interactive 3D model of Custom Alternating Tooth Gear

Gears and transmission

Custom Alternating Tooth Gear

20 views
Bounding box
10.0 × 10.0 × 17.0 mm
Engine
Precision B-rep
Parameters
9
Published
August 11, 2026

Download

Free to download and use. See the terms.

The prompt

Please write a SolidWorks VBA macro to automatically generate a custom 3D gear with the following exact specifications. The macro should create the sketches and extrusions step-by-step in a new part document. Gear Specifications: - Number of teeth: 8 - Outer diameter: 10 mm - Root diameter: 7.5 mm - Center bore (hole) diameter: 4 mm - The gear has an alternating tooth height pattern (4 long teeth and 4 short teeth, alternating). - Base extrusion height for all teeth: 10 mm - Long teeth height: 13 mm (so 4 alternating teeth extend 3 mm higher than the rest). - Hub/Shaft height: 4 mm extending from the bottom center (or adjust as a central cylindrical base). Steps the macro should follow: 1. Create a new part and sketch on the Front Plane. 2. Draw the root circle (7.5mm) and outer circle (10mm). 3. Draw the profile of a single tooth and use a circular pattern to create 8 teeth. 4. Trim unnecessary lines to form a closed gear profile. 5. Extrude the base profile to 10 mm. 6. Create a new sketch on the top face of the extrusion, project (Convert Entities) the faces of 4 alternating teeth, and extrude them by an additional 3 mm. 7. Create the center bore (4mm diameter) using an Extruded Cut through all. 8. Add a central hub (if necessary based on the standard gear shape). Please provide clear, fully commented VBA code and instructions on how to run this macro in SolidWorks.

Parameters

NameValueRange
Outer Diameter10 mm5 – 20
Root Diameter7.5 mm4 – 18
Bore Diameter4 mm1 – 8
Base Height10 mm5 – 50
Tooth Height Delta3 mm0.5 – 10
Hub Height4 mm1 – 20
Hub Outer Diameter6 mm4.1 – 7.5
Number of Teeth84 – 30
Gap Angle10 °2 – 30

Every value above is a live dimension. Open a model like this in the editor and each one becomes a slider you can drag before exporting.