Certified SOLIDWORKS Professional API (CSWP-API) Exam Prep
Free practice questions

Free CSWP-API Practice Questions

10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.

Start the free practice test → ★★★★★4.9/5 from 2,400+ candidates · No signup

The CSWP-API exam has 28 questions and runs 2 hours.

These 10 free CSWP-API questions are organized by exam domain, so you can see how each part of the Certified SOLIDWORKS Professional API (CSWP-API) blueprint is tested. Reveal the answer and explanation under each question.

Domain 1: Understanding the API Object Model

Question 1

Stop-1 and Stop-2 are two occurrences of the same part file and configuration in an assembly. Stop-1 is fixed. Stop-2 is floating and has no mates. The macro must reposition only Stop-2, without changing either occurrence's part geometry. Which object owns the Transform2 property needed for this operation?

Show answer & explanation

Correct answer: D - The Component2 object representing Stop-2.

Domain 2: Troubleshooting

Question 2

A VBA macro compiles, but with no document open it raises run-time error 91 at this condition. The SOLIDWORKS application reference swApp is valid. Dim swModel As SldWorks.ModelDoc2 Set swModel = swApp.ActiveDoc If Not swModel Is Nothing And swModel.GetType = swDocPART Then Debug.Print "Part ready" End If Why does the apparent Nothing guard fail?

Show answer & explanation

Correct answer: A - VBA evaluates GetType even when swModel is Nothing; separate the object check from the type check.

Domain 3: Part design automation

Question 3

The automated width check for a machined spacer requires 38.000 mm with an allowable deviation of plus or minus 0.010 mm. The intended configuration has rebuilt successfully. A fresh read of the driving length dimension gives SystemValue = 0.038006, while the drawing display rounds the width to 38.01 mm. The check must use unrounded model data. How should this result be recorded?

Show answer & explanation

Correct answer: A - Accept the width check: the deviation is +0.006 mm, within the permitted tolerance.

Domain 4: Drawing Automation

Question 4

A drawing has sheets named Assembly, Details, and Notes. Notes intentionally contains no model views. A macro activates each sheet successfully, but reports a missing model reference for the object returned by GetFirstView, even on sheets that contain valid model views. To inspect every model view without flagging the sheet containers as defects, the traversal should:

Show answer & explanation

Correct answer: C - Skip the first View on each sheet, then follow GetNextView until Nothing.

Domain 6: Adding sketch entities and dimensions

Question 5

In an active 2D sketch, a macro must create a 16 mm diameter circle at the sketch origin using CreateCircleByRadius. It then creates a driving diameter dimension and obtains that dimension's Dimension object. The document displays millimetres. Which pair creates the circle at the required size and leaves that size unchanged when Dimension.SystemValue is assigned?

Show answer & explanation

Correct answer: C - Radius argument: 0.008; diameter SystemValue: 0.016.

Domain 7: Feature creations such as extrudes and cuts

Question 6

A circular cut starts on the front face of a single solid plate and points into the material. Its blind depth is 10 mm. After the plate thickness increases to 16 mm, the hole no longer breaks through. The hole must remain through the plate in later thickness variants without revising a numerical cut depth; no other bodies are present. Select the feature change that preserves this design intent.

Show answer & explanation

Correct answer: C - Use a Through All cut in the direction entering the plate.

Domain 8: Selection and traversal techniques

Question 7

SelectionManager contains four objects in this selection order: 1. Mounting face, mark 0 2. Left slot edge, mark 4 3. Bore wall face, mark 4 4. Right slot edge, mark 4 No selections change before this VBA statement executes: Set picked = swSelMgr.GetSelectedObject6(2, 4) Identify the object assigned to picked.

Show answer & explanation

Correct answer: A - The bore wall face.

Domain 9: Hide/Suppress/Resolve components

Question 8

During an assembly inspection, a macro needs the faces of one visible, unsuppressed component. That occurrence is lightweight, its source file is available, and GetModelDoc2 returns Nothing. No geometry from other components is needed. Choose the recovery that addresses this condition without unnecessarily processing the whole assembly.

Show answer & explanation

Correct answer: B - Resolve the target component, check the result, and reacquire its model document.

Domain 11: Insert drawing views

Question 9

A drawing macro passes "Machined" as ViewName to CreateDrawViewFromModelView3 and receives Nothing. The source model is loaded and its path is correct. Machined is a valid configuration, but the model has no named orientation called Machined. Its standard "*Front" orientation exists. The required output is a front view of the Machined configuration. How should the programmer separate those two choices?

Show answer & explanation

Correct answer: B - Use "*Front" as ViewName; set View.ReferencedConfiguration to "Machined", then rebuild.

Domain 14: Add custom properties

Question 10

A part has Cast and Machined configurations. PartNumber is absent from both configurations and from the document-level properties. With swModel referring to that part, a macro runs: Set props = swModel.Extension.CustomPropertyManager("Machined") rc = props.Add3("PartNumber", swCustomInfoText, "00472", swCustomPropertyOnlyIfNew) The call returns rc = 0. What belongs in the completion log?

Show answer & explanation

Correct answer: A - PartNumber was added as text in Machined; zero is the Add3 success result.

The rest of the CSWP-API blueprint

The CSWP-API exam also covers these domains. Drill them in the full free practice test:

That's 10 of 1,030

The full bank has 1,020 more CSWP-API questions with explanations.

Continue in the free practice test →

View plans