Contacts
Get in touch
Close

Contacts

Romania, Cluj-Napoca – 400157
Str. Ploiești Nr. 9

Romania, Vama – 447350
Str. Fermei Nr. 14

+40 774 463 429

info@inteliscience.net

NX Replace Component: Swap Parts, Keep Constraints (2026)

NX Replace Component: The Short Version

NX Replace Component swaps a component for another part file and, with Maintain Relationships on, tries to keep constraints, WAVE links and attributes. Constraints survive when the new part is a version of the old one or carries identically named reference geometry. inteliScience, NXOpen specialists delivering from Romania, automates rule-based mass replacement behind a preview, confirm and undo gate.

The replacement part is… What NX tries to keep (Maintain Relationships on) What decides success
A version (same UID via Save As or template)Position, attributes, assembly constraints, WAVE links, interpart expressions, drawing views, PMIReferenced faces and edges still exist, with the right type
An unrelated part (different UID)Position, attributes, exploded positions, variant conditions, occurrence notesIdentical object names on the referenced geometry

The Problem: A Housing Changes Size, and Every Valve Has to Follow

“When components are replaced, what happens to the assembly constraints?” A DACH machine builder’s CAD team put that question on its list of AI use cases for NX, next to drawing automation and rebuilding migrated parts. Fair question. Replacement is where assemblies quietly lose their structure.

Picture the trigger. A housing grows by one size, its ports get larger, and every valve seated in them has to become a different valve. The design guideline in the wiki says which valve family, pressure class and body material belong to which housing. Across dozens of dependent parts, the engineer runs the same loop per occurrence: find it, look up the rule, pick the part, replace, check which constraints now fail.

Nothing in that loop needs judgment except the guideline, and the guideline is written down. That makes it automatable. Whether the constraints come through is what makes it risky.

How the Native NX Replace Component Command Works

Replace Component removes a component and puts another .prt file in its place; right-click the component in the Assemblies application. The table follows the NX 2306 help, the newest public version of these pages we could retrieve; the NXOpen builder has exposed the same options since NX 6.

Dialog group Option What it does
Components to ReplaceSelect ComponentsOne or more components to swap
Replacement PartSelect Part, BrowseFrom the graphics window, Assembly Navigator, Loaded Parts list, or a browsed file
SettingsMaintain RelationshipsWhether NX “attempts to maintain relationships, such as assembly constraints and attributes”
SettingsReplace All Occurrences in AssemblyWhether all occurrences are replaced, not only the selected one
Component PropertiesName OptionMaintain (old component name), Original (new part’s name), As Specified
Component PropertiesReference SetMaintain, Entire Part, or Empty
Component PropertiesLayer OptionMaintain, Original, Work, or As Specified

Two behaviors matter. NX alerts you when the replacement is not a revision of the original: not created from the same template, not descended from the same blank part. And for a part family member, NX tries to offer the family template so you can pick a sibling. Whether a family, WAVE or code should own your variants at all is covered in when to use part families, WAVE or NXOpen.

Our position: leave Maintain Relationships on. It is the documented default of the NXOpen builder, and switching it off to force a stubborn replacement through only moves the damage somewhere you will find it later.

It depends on whether NX considers the new part a version of the old one. Get that right and NX tries to keep almost everything; get it wrong and constraints survive only where you prepared the geometry by name.

NX identifies versions by an internal unique identifier (UID). A new blank part gets one, every Save As copy keeps it, and every part created from the same template shares it. For versions, Maintain Relationships also tries to keep assembly constraints, mating conditions, WAVE links, interpart expressions, drawing views and PMI. In the Siemens how-to, a caster fork replaced by one “derived from the same component” keeps its assembly constraints.

For unrelated parts, assembly constraints are not on the list. The documented bridge is object names: name the edge or face a constraint references in the old part (Properties, General tab), give the equivalent geometry in the new part the same name, and NX can identify which geometry the constraint should reference.

The help does not publish the internal matching logic, so we will not guess at it. It does publish the failure mode: a constraint whose reference is gone gets a status icon in the Assembly Navigator because it “references geometry that has been deleted, suppressed, or is now of the wrong type”. That matches what we told the customer’s team: constraints can generally be kept, and they break when referenced faces or other required geometry are missing on the new component.

WAVE adds one trap. The WAVE help lists replacing the component in the assembly structure as one way a link breaks; it then shows “Broken” in the Part Navigator. Repair means redefining the source, reparenting it, or removing the linked feature, and the WAVE Geometry Linker’s Replacement Assistant maps new source geometry onto the existing linked object.

Constraint basics (Fix, Touch Align, Concentric, reference sets) are in our NX assembly basics tutorial.

Why Replacing Components One by One Does Not Scale

A single NX Replace Component run is a handful of clicks. The problem is multiplication and memory, not the command.

A housing size change ripples: valves in every port, their seals, sometimes the fittings behind them, in every assembly that uses the housing. Done by hand, three things go wrong. The engineer on the eighth valve picks the part number from memory. The occurrence list is incomplete. And the constraint check happens at the end, if at all; Siemens’ own go-kart example finds seven unsolved constraints among 136 only after regrouping the Constraint Navigator by status.

Constraints are also getting cheaper to create. Siemens’ Magnetic Snap post of 17 July 2026 describes Auto Align where “the system smartly finds two constraints and adds them”, so every replacement has more references to satisfy. Designcenter NX 2606 (June 2026) is the current release, and the Designcenter 2612 Early Access Program ran until 25 September 2026. The UI keeps moving; the version rule has not.

Replace All Occurrences looks like the shortcut. It is not: it swaps every occurrence of the selected part, while the rule may want different valves depending on which housing each one sits in. We advise against it in any run where a rule, not a part number, decides.

Rule-Based Mass Replacement: How We Automate It

A driver parameter changes, a rule table picks the new part per affected occurrence, and NXOpen executes the swaps with Maintain Relationships on, behind a gate. At inteliScience we have run exactly this case: valves were replaced automatically by matching new components, based on changed housing sizes and given design guidelines. The AI does not guess a part; it applies the table and prepares the change list.

The rule table

The contract between guideline and automation. Illustrative, with fictional part numbers:

Driver parameter (housing) Condition Selection rule (from the guideline) Replacement part
PORT_SIZE = 20PRESSURE_CLASS up to 16 barSame nominal size as the port, standard bodyVLV-0020-STD
PORT_SIZE = 20PRESSURE_CLASS above 16 barSame size, high-pressure bodyVLV-0020-HP
PORT_SIZE = 25anySame nominal size, standard bodyVLV-0025-STD
PORT_SIZE = 32HOUSING_MATERIAL = stainlessSame size, stainless bodyVLV-0032-SS
no matching rownoneStop and flag the occurrence for an engineernone

The last row matters most: without an explicit no-match path, automation turns into silent guessing. If the guideline lives in a wiki such as Confluence, we connect it through its API, so rules come from the current page, not a stale export.

The automated workflow, step by step

  1. Trigger. The housing’s driving expression or attribute changes.
  2. Scope. Collect every occurrence the table covers, such as each valve in a changed housing.
  3. Decide. Per occurrence: a replacement part or a no-match flag.
  4. Pre-check. Same template lineage, or the named interface geometry present? Failures are flagged, not sent to NX.
  5. Preview. One change list, old part to new part, with the rule that fired. Nothing applied yet.
  6. Confirm. The engineer approves all, some or none.
  7. Execute. Undo mark, then replace per occurrence with Maintain Relationships on.
  8. Report. Constraints that no longer solve, failed replacements, unloaded parts.
  9. Close. Accept, fix flagged items by hand, or undo to the mark. The run is logged.

This runs as a ribbon button or a batch job over many assemblies; a chat is optional. For single ad-hoc swaps at the desk, the NX Action Assistant is the conversational version with the same preview and confirm gate.

The NXOpen calls underneath

Steps 7 and 8 are plain NXOpen. AssemblyManager.CreateReplaceComponentBuilder returns an NXOpen.Assemblies.ReplaceComponentBuilder (both “Created in NX6.0.0”), with documented defaults MaintainRelationships = true and ReplaceAllOccurrences = false. A condensed Python version:

# NXOpen Python journal: execute a confirmed replacement plan, then report
# constraints that no longer solve. Members as documented in the NXOpen
# reference; run it on a copy of the assembly first.
import NXOpen
import NXOpen.Assemblies
import NXOpen.Positioning

session = NXOpen.Session.GetSession()
work_part = session.Parts.Work
lw = session.ListingWindow
lw.Open()
RCB = NXOpen.Assemblies.ReplaceComponentBuilder

def replace_one(component, new_part_path):
    builder = work_part.AssemblyManager.CreateReplaceComponentBuilder()
    try:
        builder.ComponentsToReplace.Add(component)
        builder.ReplacementPart = new_part_path
        builder.MaintainRelationships = True    # documented default
        builder.ReplaceAllOccurrences = False   # the rule decides per occurrence
        builder.ComponentNameType = RCB.ComponentNameOption.Maintain
        builder.SetComponentReferenceSetType(RCB.ComponentReferenceSet.Maintain, None)
        load_status = builder.RegisterReplacePartLoadStatus()
        builder.Commit()
        for i in range(load_status.NumberUnloadedParts):
            lw.WriteLine("Not loaded: " + load_status.GetPartName(i)
                         + " (" + load_status.GetStatusDescription(i) + ")")
        load_status.Dispose()
        errors = builder.GetErrorList()
        for i in range(errors.Length):
            info = errors.GetErrorInfo(i)
            lw.WriteLine("Replace failed: " + info.ErrorObjectDescription
                         + " (" + info.Description + ")")
        errors.Dispose()
    finally:
        builder.Destroy()

def unsolved_constraints():
    solved = NXOpen.Positioning.Constraint.SolverStatus.Solved
    constraints = work_part.ComponentAssembly.Positioner.Constraints.ToArray()
    return [c for c in constraints if c.GetConstraintStatus() != solved]

def execute(plan):
    # plan = [(component, replacement part path), ...] as confirmed in the preview
    mark = session.SetUndoMark(NXOpen.Session.MarkVisibility.Visible,
                               "Rule-based replacement")
    for component, new_part_path in plan:
        replace_one(component, new_part_path)
    for c in unsolved_constraints():
        lw.WriteLine(c.JournalIdentifier + ": " + str(c.GetConstraintStatus()))
    return mark  # rejected run: session.UndoToMark(mark, None)

GetErrorList (added in NX 8.0.2) catches replacements that fail outright; the solver status, one of 19 states in the 1926 reference, catches the quieter case where the swap worked and a constraint lost its reference. The positioner holds the work part’s own constraints, so subassembly constraints are checked with that subassembly as work part.

This runs as a POC. What’s missing for production: a rule table your design owners sign off, a part library with consistent template lineage and named interface geometry, and a run log your CAD admin can audit. We close the gap from “the swap worked on my test assembly” to “the swap runs across the product line” with NX workflow automation: deterministic rules first, on-premise where your data requires it.

Designing Parts So Replacement Keeps Constraints

Constraints survive replacement when every candidate part carries the referenced geometry under the same identity. That is a library design problem you solve once, and it pays off for manual replacements too. What we put into a family standard before automating:

  1. One template per interchangeable family. Parts from the same template share a UID, so NX treats them as versions.
  2. Named interface geometry. For supplier or legacy parts, identical object names on referenced faces and edges are the documented way to carry constraints over (for example PORT_FACE, PORT_AXIS).
  3. Constraints on function, never decoration. Mating faces, bore axes and datums every variant has; never a chamfer or blend.
  4. Product interfaces. A Product Interface declares the faces meant for mating and can restrict constraint selection to them. Siemens’ caveat: repoint an interface to another object and linked geometry updates, assembly constraints do not.
  5. Consistent reference sets. The automatic Model reference set collects no datums or curves. Keep interface datums (or a whole Datum CSYS) in a user-defined set every variant carries under the same name, and replace with Reference Set = Maintain.

When replacement still goes wrong, the cause is almost always one of these:

Failure cause Symptom after replacement Prevention
Unrelated part, referenced geometry unnamedNot-a-revision alert; constraints not carried overSame template for the family, or identical object names
Referenced face missing on the new partConstraint flagged for deleted or suppressed geometry and ignoredConstrain only to faces, axes and datums every variant has
Face present, wrong type or sizeConstraint cannot solve; for Fit, radii or cone angles differFix interface geometry types in the standard; pre-check
New geometry makes old constraints contradictError: conflicts with other constraintsRemove redundant constraints before mass runs
WAVE parent replaced by a non-versionLinked feature shows BrokenReparent with the Replacement Assistant, or link through product interfaces
Replace All Occurrences in a mixed assemblyOccurrences the rule should skip are swappedReplace per occurrence
Faceted supplier modelGeometry not available for constraintsRequest B-rep geometry

If we could fix only one thing before automating, it would be template lineage. Names and interfaces help, but lineage is what the Siemens help explicitly ties constraint and WAVE retention to. Migrated parts without history have no lineage at all; rebuilding them from STEP on a class template is the moment to give them one.


Frequently Asked Questions

Does NX Replace Component keep assembly constraints?

Yes, when Maintain Relationships is on, the new part is a version of the old one (same UID via Save As or the same template) and it still carries the referenced geometry. For unrelated parts, constraints carry over only where referenced faces or edges have identical object names in both parts. Missing or changed geometry leaves the constraint unsolved and flagged.

Replace Component vs deleting and re-adding the part: what is the difference?

Replace Component keeps what it can: transformation, attributes, and for versions also constraints, WAVE links, interpart expressions, drawing views and PMI. Deleting and re-adding keeps none of that. For anything already constrained or referenced by a drawing, replace.

Why does NX warn that the replacement part is not a revision?

The new part was not created from the same template and does not descend from the same blank part, so its UID differs. NX still replaces it, but maintains only the smaller relationship set for unrelated parts unless the referenced geometry is named identically.

How much does automated rule-based component replacement cost?

It depends less on NXOpen than on your data: how many rules, whether the guideline is written down, and whether the library has consistent templates and named interface geometry. We scope it as a bounded proof of value on one assembly family, so effort is measured on your parts before any rollout decision.

Can I automate NX Replace Component with NXOpen?

Yes. AssemblyManager.CreateReplaceComponentBuilder returns a ReplaceComponentBuilder with the dialog’s options as properties. Set an undo mark first, then read GetErrorList and each constraint’s solver status after Commit.


Next Step

Have a housing, a valve family and a guideline that says which fits which? A free 60-minute call with inteliScience’s NX engineers checks whether your part library is ready for rule-based replacement. Book a strategy call about rule-based component replacement



References

  1. Siemens NX 2306 help, “Replace Component”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/comp_substitute.html (retrieved 29 September 2026)
  2. Siemens NX 2306 help, “Replace Component dialog box”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/comp_replace_op.html (retrieved 29 September 2026)
  3. Siemens NX 2306 help, “Maintaining relationships while replacing a component”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/comp_replace_maintain_rel_rt.html (retrieved 29 September 2026)
  4. Siemens NX 2306 help, “Replace a component with a related component”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/comp_replace_ht.html (retrieved 29 September 2026)
  5. Siemens NX 2306 help, “Replace a component with an unrelated component”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/xid385653.html (retrieved 29 September 2026)
  6. Siemens NX 2306 help, “Replace Component and part family members”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id665941/id666126/comp_replace_partfamily_rt.html (retrieved 29 September 2026)
  7. Siemens NX 2306 help, “Unsolved assembly constraints icons”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id666286/id666351/id1201557/func_details_unsolved_constraints_op.html (retrieved 29 September 2026)
  8. Siemens NX 2306 help, “Resolve assembly constraint issues using the Constraint Navigator”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id666286/id666351/id1267687/id1267739.html (retrieved 29 September 2026)
  9. Siemens NX 2306 help, “Broken and inactive WAVE links”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id668786/id742403/id670066/id670031/wave_geo_link_broken_links_rt.html (retrieved 29 September 2026)
  10. Siemens NX 2306 help, “Replace a parent part for WAVE-linked geometry”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id668786/id742403/id670066/id670031/wave_geo_link_edit_rep_parent_ht.html (retrieved 29 September 2026)
  11. Siemens NX 2306 help, “Product Interfaces”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id668786/id742405/product_interface_ov.html (retrieved 29 September 2026)
  12. Siemens NX 2306 help, “Reference sets” and “Model reference set”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id668331/reference_sets_ov.html and https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id668331/id668266/reference_sets_model_ov.html (retrieved 29 September 2026)
  13. Siemens NX 2306 help, “Tips for working with assembly constraints and joints”: https://docs.sw.siemens.com/documentation/external/PL20221117716122093/en-US/nx_help/nx/2306/nx_help/en-US/assemblies/id666286/id666351/assy_constraints_notes.html (retrieved 29 September 2026)
  14. Siemens NXOpen .NET Reference Guide (1926), NXOpen.Assemblies.ReplaceComponentBuilder: https://docs.sw.siemens.com/documentation/external/PL20191127135844554/en-US/nx_api_sc/nx/1926/nx_api_sc/en_US/nxopen_net/a00956.html (retrieved 29 September 2026)
  15. Siemens NXOpen .NET Reference Guide (1926), NXOpen.Assemblies.AssemblyManager: https://docs.sw.siemens.com/documentation/external/PL20191127135844554/en-US/nx_api_sc/nx/1926/nx_api_sc/en_US/nxopen_net/a00891.html (retrieved 29 September 2026)
  16. Siemens NXOpen .NET Reference Guide (1926), NXOpen.Positioning.Constraint (SolverStatus): https://docs.sw.siemens.com/documentation/external/PL20191127135844554/en-US/nx_api_sc/nx/1926/nx_api_sc/en_US/nxopen_net/a07180.html (retrieved 29 September 2026)
  17. Siemens NXOpen .NET Reference Guide (1926), NXOpen.Session (undo marks): https://docs.sw.siemens.com/documentation/external/PL20191127135844554/en-US/nx_api_sc/nx/1926/nx_api_sc/en_US/nxopen_net/a07788.html (retrieved 29 September 2026)
  18. Siemens Designcenter blog, “Designcenter | Tips and Tricks | Assemblies and Magnetic Snap”, 17 July 2026: https://blogs.sw.siemens.com/designcenter/nx-tips-and-tricks-magnetic-snap/ (retrieved 29 September 2026)
  19. Siemens Designcenter blog, “Designcenter is for everyone | June 2026 release”, 23 June 2026: https://blogs.sw.siemens.com/designcenter/designcenter-is-for-everyone-june-2026-release/ (retrieved 29 September 2026)
  20. Siemens resources, “Welcome to the September 2026 Early Access Program for Designcenter” (Designcenter 2612): https://resources.sw.siemens.com/en-US/presentation-welcome-to-designcenter-early-access-program/ (retrieved 29 September 2026)