add_sketch_chamfer
Adds a 45° equal-distance chamfer to a sketch corner, replacing the vertex where two lines meet with a new inclined line.
Instructions
Chaflán de croquis — corta una esquina del croquis con un chamfer a 45° (distancia igual en ambos lados). Reemplaza el vértice donde dos líneas se encuentran con una tercera línea inclinada.
Uso típico CSWA Tool Block: las esquinas del outline llevan chamfers como "5×45°" (= distance_mm=5). Es más limpio que dibujar la línea inclinada a mano.
[en: Sketch chamfer — cuts a sketch corner with a 45° equal-distance chamfer. Replaces the vertex where two sketch lines meet with a third inclined line. Typical for the CSWA Tool Block outline.]
Args: line1_x_mm, line1_y_mm: A point that lies ON the first line. Typically near the corner — SW picks the closest segment. line2_x_mm, line2_y_mm: A point that lies ON the second line. distance_mm: The chamfer distance from the corner along EACH line. A 45° chamfer with distance_mm=14 means each adjacent line is shortened by 14 mm and the corner is connected by a new line at 45°. z_mm: Z-coordinate of the points (default 0 — front-plane sketches).
Returns the chamfer's metadata.
Requires the sketch to be in EDIT mode (just like add_sketch_dimension). The two selected lines must be ADJACENT (share an endpoint), else SW rejects the chamfer.
Gotcha: in this binding ISketchManager.CreateChamfer is not
universally reachable. If it fails, the recommended workaround is to
draw the chamfer manually using two create_line calls.
Related: chamfer (3D edge chamfer, not sketch corner).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| z_mm | No | ||
| line1_x_mm | Yes | ||
| line1_y_mm | Yes | ||
| line2_x_mm | Yes | ||
| line2_y_mm | Yes | ||
| distance_mm | Yes |