SolidWorks Automation (API/Macros), PDM, Simulation, Motion, Rendering, and Troubleshooting
Overview
The gap in SolidWorks productivity between large enterprises and SMB manufacturers is not about modeling skill — it comes down to automation, data management, and incident response. Repetitive tasks get handled by macros, design data is controlled in PDM, analysis, animation, and rendering drive verification and communication, and when errors surface, recovery is systematic. This guide covers macros/API (VBA, VB.NET, C#), PDM (vault, check-out, Version/Revision, Workflow), SimulationXpress/Simulation, Motion Study, Rendering (PhotoView 360 / Visualize), the most common troubleshooting (Rebuild/Dangling/Mate/File Repair), and 2024/2025 new features (Detailing Mode, Component References, Configuration Publisher) from a practical standpoint. For shortcuts see 01-shortcuts-ui.md; for assembly and performance fundamentals see 03-assembly.md.
1. Macros and the API
1.1 Start by Recording a Macro
Menu path: Tools → Macro → Record. Your UI actions are recorded as VBA code, and pressing Stop saves a .swp (source) / .swb (binary) file. Press Alt+F11 to open the built-in Visual Basic Editor and edit it.
1.2 Choosing an API Language
| Language | Pros | Cons |
|---|---|---|
| VBA | Built into SolidWorks, stored in the file, easy entry | Dated debugger, limited error handling |
| VSTA (VB.NET/C#) | Modern .NET, built into SolidWorks | Distribution is relatively more involved |
| External .NET Add-in (C#) | Free-form UI, flexible distribution | Requires a separate Visual Studio install |
| Standalone EXE | Deployable to many PCs, schedulable | Needs SolidWorks running to connect |
1.3 API Object Model
SldWorks (top-level application)
└── ModelDoc2 (common to parts/assemblies/drawings)
├── PartDoc
├── AssemblyDoc
├── DrawingDoc
├── FeatureManager
├── SketchManager
└── SelectionMgr
Most real-world macros read or create features via SldWorks → ModelDoc2 → FeatureManager.
1.4 Minimal VBA Example — Create a Box
Sub CreateBox()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.NewPart
swModel.SketchManager.InsertSketch True
swModel.SketchManager.CreateCornerRectangle 0, 0, 0, 0.1, 0.1, 0
swModel.FeatureManager.FeatureExtrusion3 True, False, False, _
0, 0, 0.05, 0, False, False, False, False, _
0, 0, False, False, False, False, 1, 1, 1, 0, 0, False
End Sub
Creates a 100mm × 100mm × 50mm extruded box. The argument order for FeatureExtrusion3 comes up a lot, so keep the API Reference in Help bookmarked.
1.5 Real-World Automation Scenarios
- Bulk BOM export to Excel: Open every
.sldasmin a folder, pull the BOM sheet → save as a combined Excel. - Bulk drawing PDF conversion: An overnight task converts hundreds of
.slddrwfiles to PDF/A. - Pack & Go automation: Scan per-project folders and package with all references.
- Bulk Custom Properties updates: Update Material, Revision, and Drawn By across thousands of parts to a rule.
- Automatic part numbering: Populate Custom Properties per PLM rules + rename files.
1.6 Macro Distribution
.swbbinaries protect the source but are hard to edit or share.- Place
.swpfiles in a company shared folder and surface them as Macro Feature buttons on the CommandManager for accessible shared macros. - In a PDM environment, store macros in the Vault as well for revision control.
2. PDM — Product Data Management
2.1 PDM Standard vs Professional
| Item | Standard | Professional |
|---|---|---|
| User count | Up to 10 | Unlimited |
| Database | SQL Express (2GB limit) | Full SQL Server |
| Workflow states | Up to 10 | Unlimited |
| Custom Columns | Limited | Unlimited |
| Web Client | No | Yes |
| Replication | No | Yes (multi-site) |
| Task Scheduler | No | Yes |
Standard comes bundled with SolidWorks Professional; upgrade to Professional as Simulation and Workgroup needs grow.
2.2 Check-Out / Check-In Basics
- Check-Out: Acquire edit rights on a file. Other users cannot modify.
- Check-In: Upload to the Vault after editing, creating a new Version.
- Undo Check-Out: Discard edits and keep the previous Version.
- Get Latest: Grab a read-only latest copy without a Check-Out.
2.3 Version vs Revision — Often Confused
- Version: The internal number (1, 2, 3…) that auto-increments on every Check-In. Tracks every minor change.
- Revision: The external number (A, B, C or 1, 2, 3) formally approved at a Workflow Transition. The value shown in BOMs and drawings.
A designer can save ten times and only the Version increments to 10 — the Revision stays put. Revision changes only through a release-approval event.
2.4 Workflow
- State:
In Progress → Under Review → Approved → Released → Obsolete. - Transition: conditions for moving between states (permissions, required properties, quantity checks, etc.).
- On Transition, automatic actions fire: Revision increment, Custom Property update, email notifications, Dispatch scripts.
2.5 PDM Best Practices
- Enforce naming conventions via Dispatch. Check-Ins are blocked when a filename violates the rule.
- Required Custom Properties. Reject Check-Ins missing Description, Material, or Designer.
- Automate the Revision Table. A Workflow Transition automatically adds a row to the drawing's Revision Table.
- Use History. Gets, Check-Outs, and Check-Ins are all logged for audit trails.
- Separate User/Group permissions. Approver, designer, and buyer permissions are split to protect released files from corruption.
- Task Scheduler (Professional only) — overnight automated PDF/STEP conversion and backup. Feature expansion in 2025.
3. SimulationXpress / Simulation
3.1 SimulationXpress
Included by default in SolidWorks Standard. Supports single-body parts + linear static analysis only. The available conditions are essentially limited to Fixtures and Force/Pressure. Multi-body, assembly, nonlinear, thermal, and dynamic studies are not possible.
3.2 Additional Studies in Simulation Premium/Professional
- Static: Linear static (includes the SimulationXpress scope).
- Frequency: Natural frequency / mode analysis.
- Buckling: Buckling.
- Thermal: Steady-state / transient thermal.
- Drop Test: Drop impact.
- Fatigue: Fatigue life.
- Nonlinear: Large deformation / nonlinear materials (Premium).
- Dynamic: Time-domain dynamic analysis (Premium).
3.3 Mesh
| Type | Characteristics |
|---|---|
| Standard Mesh | Uniform size. For simple geometry. |
| Curvature-based Mesh | Size auto-adjusts to curvature. Recommended default. |
| Blended Curvature-based | Smooth transitions. Good when body count is low. |
| Draft Quality | 1st-order (linear) elements. Fast but inaccurate. |
| High Quality | 2nd-order elements. Accurate but slow. |
3.4 Boundary Conditions and Loads
- Fixture: Fixed Geometry, Roller/Slider, Fixed Hinge, Reference Geometry, Symmetry.
- Load: Force, Torque, Pressure, Gravity, Bearing Load (cosine cylindrical distribution), Remote Load (force transmitted from a remote point).
3.5 Interpreting Results
- Von Mises Stress: Equivalent stress. Suited to ductile materials.
- Principal Stress (P1/P3): Principal stresses. Suited to brittle materials.
- Displacement: Displacement. Always annotate the visual exaggeration factor.
- Factor of Safety (FOS): Allowable stress / applied stress. Aim for 3 or more under general static loads and 5 or more under cyclic/dynamic loads.
4. Motion Study
4.1 Three Levels
| Level | Capability | License |
|---|---|---|
| Animation | Mate/Explode-based animation. No physics. | Standard |
| Basic Motion | Gravity, springs, motors, some contact. Approximate physics. | Standard |
| Motion Analysis | Full dynamics. Forces, moments, inertia, dampers, contact. | Premium |
4.2 Motor / Spring / Gravity / Contact
- Rotary Motor: Axis + RPM or angular velocity (°/s). Functions: Constant, Distance, Oscillating, Segments, Expression, etc.
- Linear Motor: Linear direction + velocity/acceleration.
- Linear Spring: Between two points. Free length and spring constant (N/mm). Setting the free length different from the Mate neutral state lets you represent preload.
- Torsion Spring (Motion Analysis only): Rotation axis, torque-angle.
- Gravity: Direction (X/Y/Z) and magnitude (default 9.81 m/s²).
- Contact: Collision and friction between Solid Bodies. Friction Coefficient (Coulomb friction), Restitution Coefficient (0–1, elastic rebound).
4.3 Best Practices
- Disable Lightweight. Motion Analysis requires fully resolved state.
- Simplify Mates. Motion Analysis turns every Mate into an equation, so more Mates means slower solves.
- State Initial Conditions explicitly. Manage each component's initial velocity/position via Fixed/Float.
- Tune Step size. The default is coarse; use 0.01 s or smaller for precision.
- Motion → Simulation linkage. Loads extracted from Motion can be fed into Simulation for time-varying-load structural analysis.
5. Rendering
5.1 From PhotoView 360 to Visualize
5.2 SOLIDWORKS Visualize
- A separate application (can be installed alongside). Bundled with SolidWorks Professional and above.
- GPU-accelerated (NVIDIA RTX recommended). Based on CUDA/OptiX.
- Editions: Standard / Professional / Connected.
Professional adds: keyframe Animation, physics-based Simulation (gravity, collisions), automatic Turntable/Explode animation, PLM Design Data integration.
5.3 Appearance / Scene / Lighting
- Appearance: Part Level / Body Level / Feature Level / Face Level — four tiers. Priority goes
Face > Feature > Body > Part. - Scene: Basic (simple backgrounds), Studio (HDRI-based). Custom
.hdrsupported. - Lighting: Ambient, Directional, Point, Spot, HDR Environment. A single HDRI is often more realistic than three point lights.
5.4 Render Output Best Practices
- Camera composition is 70% of quality. Place the subject at the one-third point of the frame.
- Use Depth of Field to focus on the subject and blur the background.
- Lock in consistency with a company-standard materials library.
- A Turntable animation is powerful for product promotion. One click in Visualize.
- PNG supports an alpha (transparent) channel. Essential for catalog compositing.
6. Troubleshooting
6.1 Rebuild Error Resolution Order
- Work from the topmost error. Upstream feature errors cascade downstream.
- Right-click the error icon → check the specific message in What's Wrong?.
- Ctrl+Q Force Rebuild — surfaces hidden errors or clears them automatically.
- Re-select references with
Edit Feature. - Last resort — delete the feature and recreate it.
6.2 Dangling Dimension / Relation
- Yellow = the reference entity is lost.
- Inside sketch edit,
Display/Delete Relations→ set the filter to Dangling. - Drag the red handle to reattach to a new entity, or delete entirely and re-constrain.
6.3 Mate Errors
- Mate conflicts or lost references in the assembly.
- MateXpert auto-diagnoses — it proposes the offending Mates and suggests fixes.
- For Over-defined states, remove Mates one at a time to narrow down the conflict.
6.4 File Repair
- After a crash, the Recover documents dialog appears automatically on restart.
- In the File Open dialog, pick Open and Repair from the bottom-right dropdown.
- SolidWorks Explorer: Right-click in Windows Explorer → safely perform reference fixes, Pack & Go, and Rename.
6.5 Common Errors and Fixes
| Symptom | Cause | Fix |
|---|---|---|
| "Unable to create feature" | Self-intersection, zero thickness | Check the sketch, reduce the fillet radius |
| "Zero thickness geometry" | Fillet/Shell produced zero thickness | Reorder features |
| Shell fails | Small fillet / sharp edge | Adjust Fillet order, set Multi-thickness |
| Mate "Over-defined" | Duplicate/conflicting Mates | Run MateXpert, remove unneeded Mates |
| Drawing doesn't update | Reference path changed | Pack & Go or File → Find References |
| "Missing file" | Filename/path changed | Reconnect via Browse, Check-In to PDM |
| Large assembly unresponsive | Out of memory | Lightweight, SpeedPak, Defeature |
6.6 Data-Loss Prevention
- Auto-save at 10 minutes or less (
Tools → Options → System Options → Backup/Recover). - Keep 5 or more backups.
- Periodic project backups via Pack & Go.
- Dual-backup with Windows File History, OneDrive, or Dropbox.
- Overnight automated backups via the PDM Task Scheduler (Professional only).
7. 2024 / 2025 New-Feature Summary
7.1 SolidWorks 2024
- Active Section View — move the section plane dynamically on a drawing.
- Improved Assembly change detection — on large assemblies, only the changed portion is rebuilt.
- Hole Wizard 30% faster.
- MBD Auto-Balloon — automatic numbering on 3D PMI.
- Toolbox Contextual Toolbar — faster access.
7.2 SolidWorks 2025
- Detailing Mode improvements — edit drawings of large assemblies without Resolving. Load times shrink from minutes to seconds.
- Component References — tag each instance individually when the same part serves multiple purposes (e.g., "LEFT", "RIGHT").
- Copy with Mates expanded — includes Advanced and Mechanical Mates (Slot, Width, etc.).
- Configuration Publisher update — refined web interface.
- Large Design Review (LDR) — Component Preview Window, Breadcrumbs navigation.
- Defeature Silhouette — optimized for 3D-print export.
- Sheet Metal relief automation — improved corner-relief algorithm.
- PDM Task Scheduler expansion — overnight automated PDF/STEP conversion.
7.3 3DEXPERIENCE Works (2025)
- AI Copilot — natural-language commands (e.g., "Add M8 hole 10mm from the edge").
- Generative Design — specify load and weight targets → AI proposes optimized geometry.
- Cloud BOM — real-time sharing across design, purchasing, and manufacturing departments.
Field Checklist
- At least one candidate repetitive task identified for macro automation
- Recorded macros refactored to remove absolute paths and names
- Policy established for checking design files into the PDM Vault
- Team members differentiate Version and Revision in usage
- Revision and Custom Properties auto-update on Workflow Transition
- Simulation boundary conditions reflect real support situations
- Stress singularities resolved by adding fillets
- Before Motion Analysis, Lightweight disabled and Step size tuned
- Rendering environment migrated to Visualize (PhotoView dependency removed)
- Auto-save interval and backup count at 10 min / 5 or more
- Rebuild errors handled from What's Wrong? in top-down order
- Detailing Mode used to edit large-assembly drawings (2025)