measure_distance
Measure the minimum distance, gap or angle between two points, faces, edges, cylinders or sketch references in a SOLIDWORKS part or assembly.
Instructions
Measure between two model points, or between the two faces or edges at those points. For faces and edges it returns the minimum distance, the normal distance when they are parallel, and the angle when they are not. In an assembly, measure between two references ref1 / ref2, picked as in add_mate, including edges and vertices by edge_id / vertex_id from list_component_faces with include (also on parts inside sub-assemblies): the result has the minimum distance, for two flat faces the angle between them and the gap when parallel, and for two cylinders the axis-to-axis distance. distance is always the MINIMUM (to a small face this can be to its edge); normal_distance is the PERPENDICULAR distance to the plane (parallel faces, or a point and a flat face). Read-only.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "measure_distance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref1 | No | What to pick. One of: {point} the face at an assembly point; {component, point} the face of that component at the point; {component, face_id} a face from list_component_faces; {component, edge_id or vertex_id} from list_component_faces(include); {component, sketch, point_id} or {component, sketch, segment_id} a sketch point or segment from list_component_sketches; {component, plane} / {component, axis} / {component, origin: true} the part's own plane, axis or origin; {plane} / {axis} / {origin: true} the assembly's own. A component inside a sub-assembly is named by its path, e.g. 'Door-1/Slat-3'. | |
| ref2 | No | What to pick. One of: {point} the face at an assembly point; {component, point} the face of that component at the point; {component, face_id} a face from list_component_faces; {component, edge_id or vertex_id} from list_component_faces(include); {component, sketch, point_id} or {component, sketch, segment_id} a sketch point or segment from list_component_sketches; {component, plane} / {component, axis} / {component, origin: true} the part's own plane, axis or origin; {plane} / {axis} / {origin: true} the assembly's own. A component inside a sub-assembly is named by its path, e.g. 'Door-1/Slat-3'. | |
| unit | No | mm, cm, m, inch or ft | |
| point1 | No | ||
| point2 | No | ||
| between | No | points = straight distance between the two points; faces = between the faces containing the points; edges = between the edges nearest the points | points |
| tolerance | No | How far a point may be from its face / edge (default 0.5 mm) |