Skip to content

Add NX 2606 interactive hosting, modeling tools and agent API improvements - #5

Draft
xuio wants to merge 67 commits into
DreamEnding:masterfrom
xuio:upstream/nx2606-integration
Draft

Add NX 2606 interactive hosting, modeling tools and agent API improvements#5
xuio wants to merge 67 commits into
DreamEnding:masterfrom
xuio:upstream/nx2606-integration

Conversation

@xuio

@xuio xuio commented Sep 6, 2026

Copy link
Copy Markdown

This PR extends NX_MCP for use with a graphical NX 2606 session. It addresses geometry and API failures, adds modeling and inspection workflows, and improves how MCP clients discover tools, inspect results and recover interrupted operations.

The changes are grouped below for review. Feedback on scope and architecture is welcome; I can split the implementation into smaller PRs if preferred.

Geometry correctness and operation recovery

  • Correct sketch-local coordinate mapping and default extrusion direction for principal and custom sketch planes.
  • Replace unsupported NX API calls used for feature lookup, extrusion editing, feature deletion, sketch constraints, native patterns and STEP import. Angle measurement now resolves typed line, straight-edge and planar-face references.
  • Return all resulting bodies for operations that create disconnected solids.
  • Add references with session, generation and owner-part context, including stale-reference rejection and assembly occurrence identity.
  • Add durable mutation IDs, duplicate-request detection, operation-status queries and explicit checkpoint rollback. Results distinguish committed, rolled-back, partial and unknown outcomes.

Interactive NX control

An optional graphical host dispatches queued operations serially on the NX UI thread, allowing users to see modeling changes as they happen. Pause, resume and stop controls support handoff between the agent and manual editing.

The integration also adds loaded-part activation, viewport capture, visibility/color/transparency controls, collision highlighting and capped section views. Screenshots can be retrieved through MCP rather than returning only a Windows file path.

Long native operations can still block the UI; this does not run NXOpen mutations concurrently.

Geometry and assembly inspection

  • Enumerate features, sketch curves, faces, edges and component occurrences.
  • Measure assembly bounds, minimum distance, clearance and interference with nested occurrence transforms.
  • Return units, coordinate frames, resolved references and closest points where applicable.
  • Distinguish exact geometry results from bounding-envelope checks.
  • Inspect sketch solver status, remaining degrees of freedom and constraint relationships.
  • Select geometry by explicit rules and re-resolve those rules after edits, rejecting ambiguous matches.

Modeling and documentation tools

The optional integration adds workflows for:

  • Sketches and solids: editable sketch geometry, dimensions and relations, expression-driven parameters, additional feature limits and boolean-target controls.
  • Assemblies: initial and absolute placement, serial bulk operations, component lifecycle controls and editable native component patterns.
  • Freeform geometry: editable 3D splines, surface meshes, bridge surfaces, trim/sew/thicken and sampled curvature/continuity analysis.
  • Imported geometry: native face translation, offset, replacement and deletion with healing.
  • Sheet metal: native operation wrappers, parameter inspection, flat-pattern selection/export and associative bend tables.
  • Documentation and manufacturing: exploded views and trace lines, drafting views, BOMs and balloons, supported annotation edits, native threads, PMI/GD&T and sampled wall-thickness/draft analysis.

Capability metadata records operation-specific availability and tested scope. These additions do not imply that every NX operation, sheet-metal configuration or manufacturing standard is covered.

Manufacturing follow-up adds associative dimension formatting, hidden-edge and construction-geometry controls, and analytic planar DXF export with explicit frames, units and layers. Drawing scale is applied to sheets and base views; managed table ownership survives reopening. STEP failures return translator diagnostics and clean up failed new-part imports. Model-health reports include fault codes and entity references. Saving targets only the work-part file. Its receipt identifies saved files, records native save errors, and compares loaded-part flags and file hashes before and after the call. Unexpected changes return a partial-outcome error. Native full/agent tests verified an edited child remained unsaved and its disk bytes unchanged; component files require explicit activation and saving.

Native PDF checks verified a 2:1 view and physical +0.05/-0.02 mm dimension tolerances. Independent DXF checks covered principal/custom planes and inch conversion. Two vendor geometry failures remain documented: one STEP produces no NX translator output, and another contains self-intersecting faces that native healing did not repair. The native centerline preference remains read-only because its setter did not persist. Follow-up shell-by-shell import did not produce a valid CLIFF solid after recombination, and Optimize Face left the Adam Tech faults unchanged. Neither route is exposed as a repair. A separate centerline annotation-visibility probe did not complete; visibility behavior remains unverified.

A02 follow-up fixes section-view construction filtering: sheet-owned section lines are preserved instead of being passed to model-geometry erasure. Component inventory now reports unloaded prototypes without aborting; explicit loading can recover them on an already loaded parent, and closing referenced prototypes is rejected before saving. PDF export updates drafting views, includes shaded raster images and reports output settings. Hidden-line processing semantics are documented, including invisible font 0 for suppressing occluded edges.

MCP discovery, responses and files

The existing default tool surface remains available. The optional integration exposes 189 tools, with a separate compact agent profile exposing 13 entry points.

The agent profile provides:

  • On-demand tool discovery with schemas, prerequisites, examples and native-test metadata.
  • Validated invocation of underlying tools.
  • Compact responses retaining references, units, warnings, mutation outcomes and result counts.
  • Filtered, paginated inspection and stored-result expansion without repeating a mutation.
  • Snapshot retention and cleanup separate from durable mutation recovery records.
  • Bounded bridge receipts with immutable full-result pagination, preserving committed outcomes when a result is too large to send.
  • Discriminated batch payload schemas and explicit argument limits.

File operations support nested workspace folders and absolute NX-host paths that remain inside the configured workspace. Artifact transfer includes metadata and checksums, and assembly packaging includes referenced-part dependencies.

Compatibility and review

The implementation retains the two-process architecture, NX-free sidecar imports, experimental/journal opt-ins and workspace confinement.

The main areas needing architectural review are:

  1. Reference and mutation-recovery contracts.
  2. Graphical host lifecycle and manual handoff.
  3. Acceptance of absolute paths inside the workspace.
  4. Placement of advanced tools in an optional profile or separate package.
  5. Compact discovery and response contracts.

The PR includes incremental implementation commits and tests. Documentation is consolidated into the three existing upstream pages plus tool contracts, the agent guide and the generated capability matrix. Release-by-release documents and overlapping guides have been removed; historical evidence remains in git history, with test-dependent examples retained as fixtures. I can extract focused PRs around agreed boundaries.

Validation

Dev22 runtime 6125b7dac2c85bc0df2c974bc032690bab4e3de0 passed 918 automated tests, formatting checks and sidecar type checks. The Windows release is installed. Native fixtures verified section edits, shaded PDF output, hidden-edge invisibility after save/reopen, unloaded-prototype inventory and explicit recovery. The 28-part working session was restored with 340 occurrence paths/transforms unchanged. Earlier dev21 full/agent save-audit checks preserved an unsaved child and unrelated loaded files/flags.

Earlier dev20 native checks covered empty-session STEP import, full/agent delivery of a 2,032-object appearance result, pagination, idempotent replay and appearance restoration. These remain recorded separately from the dev21 save checks.

The dedicated real-NX test is excluded from the ordinary suite. Separate NX 2606 runs exercised recorded native fixtures, Windows stdio/HTTP operation, installed-source verification and inline PNG delivery.

Two fresh agents completed matching plate, assembly and STEP round-trip tasks with analytic geometry checks. That comparison used the earlier full profile and initial compact profile; subsequent pagination and discovery fixes received a separate follow-up on the final runtime.

The remaining legacy-tool pass checks typed angle measurement, horizontal sketch constraints, feature deletion, inventories, nested Save As, relative-placement replay, explosion deletion and downloaded assembly packages. Capability labels now distinguish 181 native-scoped tools and eight sidecar/contract-scoped tools; option-level caveats remain.

See the validation guide, tool contracts and capability matrix.

NX 2606 results do not establish NX 2506 compatibility. Native evidence applies to the recorded fixtures; sampled analyses do not certify entire surfaces or parts. Provider token usage was unavailable, so response-size measurements are not presented as total token savings.

xuio added 30 commits September 5, 2026 16:06
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xuio xuio changed the title Add NX 2606 integration, interactive hosting and optional modeling tools Add NX 2606 interactive hosting, modeling tools and agent API improvements Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant