catia_drawing_add_dimension
Add a linear, diameter, or radius dimension to a CATIA V5 drawing view at specified coordinates, with offset and orientation controls.
Instructions
Add ONE dimension to a view, in view coordinates (u, w) (mm, model scale, see catia_drawing_add_view). type='linear': from and to points, orientation horizontal | vertical | aligned, the dimension line is placed offset_mm (paper) away on side (below/above for horizontal, right/left for vertical, left/right of the from->to direction for aligned). type='diameter' or 'radius': centre and diameter/radius of the circle, leader at leader_angle_deg. Take the values from the model (catia_list_faces gives cylinder radii and axes), never from memory: the dimension shows the value you give, the tool cannot attach it to the generated edge; catia_drawing_check compares it with the PDF.
ISO 129-1: one dimension per feature, keep dimension lines >= 10 mm from the outline (offset_mm default 10), each following line 7 mm further. prefix e.g. '4x ' for identical holes. Returns JSON {dimension, type, value_mm, expected_mm, line}; a value that differs from the request by more than 0.005 mm removes the dimension and fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | linear: second point [u, w]. | |
| from | No | linear: first point [u, w]. | |
| side | No | ||
| type | Yes | ||
| view | Yes | View name (see catia_drawing_info). | |
| centre | No | diameter/radius: circle centre [u, w]. | |
| prefix | No | Text before the diameter/radius symbol and value, e.g. '4x ' is written before the diameter symbol. | |
| radius | No | radius dimension: the circle radius, mm. | |
| drawing | No | Name of the CATDrawing document (default: the active document). | |
| diameter | No | diameter dimension: the circle diameter, mm. | |
| offset_mm | No | Distance of the dimension line from the feature, paper mm. | |
| orientation | No | horizontal | |
| allow_duplicate | No | diameter/radius: allow a second dimension of the same value in the view (refused by default, ISO 129-1). | |
| leader_angle_deg | No | diameter/radius: direction of the dimension line, degrees counter-clockwise from +u. |