Allow persistent tool-level stepdown/stepover values via API

Allow persistent tool-level stepdown/stepover values via API

sebastien_denoncourt
Explorer Explorer
231 Views
0 Replies
Message 1 of 1

Allow persistent tool-level stepdown/stepover values via API

sebastien_denoncourt
Explorer
Explorer
## Summary

When programmatically setting `tool_stepdown`, `tool_stepover`, `use_tool_stepdown`, and `use_tool_stepover` on a tool via the Fusion CAM API, the values do not persist after `updateToolLibrary()` and reload. The tool-level parameters always revert to the default formulas (`tool_fluteLength * 0.9` and `tool_diameter * 0.3`).

**Preset-level** stepdown/stepover values (via JSON injection) work correctly and persist — but the Tool Library UI always displays the tool-level defaults, which is confusing for users.

## Context / Use Case

I'm building an automation script that imports cutting data from external XML files (FeatureCAM format) into Fusion  tool libraries. Each XML contains per-material, per-operation cutting parameters including stepdown and stepover values that vary by operation type:

- Profile Rough: stepdown = 0.11", stepover = 0.112"
- Face Rough: stepdown = 0.31", stepover = 0.312"
- Plunge Rough: stepdown = 0", stepover = 0.4"

## What Works

Per-preset stepdown/stepover via JSON injection works perfectly:

```python
tool_json = json.loads(tool.toJson())
presets = tool_json['start-values']['presets']
presets.append({
    "name": "Aluminum - Profile - Rough",
    "n": 11000,
    "v_f": 110,
    # ... other feed values ...
    "use-stepdown": True,
    "stepdown": 0.11,
    "use-stepover": True,
    "stepover": 0.112,
})
new_tool = adsk.cam.Tool.createFromJson(json.dumps(tool_json))
```

These values:
- ✅ Are stored correctly in the JSON
- ✅ Persist after save/reload
- ✅ Are applied correctly when selecting the preset in a CAM operation
- ❌ Are NOT displayed in the Tool Library editor UI (shows tool-level defaults instead)

## What Doesn't Work

Setting tool-level parameters via the API:

```python
tp = tool.parameters
tp.itemByName('use_tool_stepdown').expression = "true"
tp.itemByName('tool_stepdown').expression = "0.11 in"
```

This appears to succeed (no error, value reads back correctly), but after `updateToolLibrary()` and reload, the values revert to:
- `tool_stepdown = tool_fluteLength * 0.9`
- `tool_stepover = tool_diameter * 0.3`
- `use_tool_stepdown = false`
- `use_tool_stepover = false`

## Systematic Testing Performed

I conducted extensive testing to find a workaround:

| Approach | Result |
|---|---|
| `tool.parameters.itemByName('tool_stepdown').expression = "0.11 in"` | Doesn't persist after save/reload |
| JSON injection at `start-values` level (outside presets) | Ignored by `createFromJson` |
| JSON injection at tool top-level | Ignored by `createFromJson` |
| JSON injection in `geometry` section | Ignored by `createFromJson` |
| Alternative JSON keys (`ap`, `ae`, `tool_stepdown`) | Ignored |
| Double-save (save → reload → set via API → save again) | Still reverts on next reload |
| `ToolLibrary.toJson()` modification + `createFromJson()` | No tool-level stepdown fields exist in library JSON |

## The Problem

The Tool Library editor UI displays the **tool-level** stepdown/stepover values, not the per-preset values. Since the tool-level values cannot be set persistently via the API, users see the default formulas even though the correct per-preset values are stored and functional in CAM operations.

This creates confusion: the cutting data appears wrong in the library editor, even though it works correctly when applied to operations.

## Request

Please add one of the following:

1. **Make tool-level `tool_stepdown` / `tool_stepover` / `use_tool_stepdown` / `use_tool_stepover` persist** when set via `tool.parameters` and saved with `updateToolLibrary()`.

2. **Or** update the Tool Library editor UI to display per-preset stepdown/stepover values when a preset is selected, rather than always showing the tool-level defaults.

3. **Or** add JSON keys at the tool level (outside presets) that control the default stepdown/stepover display, similar to how `"n"` (RPM) works at the start-values level.

## Environment

- Fusion (latest production build, February 2026)
- Python API
- Windows 10/11
- Local tool libraries
0 Likes
232 Views
0 Replies
  • API
Replies (0)