CadQuery Solid object has no attribute extrude

Diagnostic signature

'Solid' object has no attribute 'extrude'

Workplane.val returns the selected shape. A Solid is not the Workplane modelling chain and does not provide Workplane.extrude.

What it means

Python attempted to resolve extrude on a Solid instance and found no such attribute. CadQuery did not start the requested extrusion.

Why it happens

Calling val changed the receiver from a Workplane to a shape before a Workplane-only operation. Workplane and Solid expose different APIs. Keeping a shape for inspection is valid, but it cannot be used as though it were the original modelling chain.

Minimal reproduction

import cadquery as cad
body = cad.Workplane("XY").circle(3).extrude(4)
result = body.val().extrude(4)

How to fix it

Keep the Workplane chain for modelling. For this raised boss, select the top face, create the intended 2 mm radius profile, and extrude it by 4 mm. Use val only when a shape is actually needed for inspection or a shape API.

```python
import cadquery as cad
body = cad.Workplane("XY").circle(3).extrude(4)
result = body.faces(">Z").workplane().circle(2).extrude(4)
```

Step 1

Step 2

Step 3

Upstream references

CadQuery Workplane.val reference

CadQuery 2.8.0 Workplane extrusion source