Expand description
REPLACE COMPONENT, the app side: what a replacement can be (a stored
part, or a part the assembly already carries), which occurrences a
“Replace all instances” covers, and the one door the menu, the summary and
the automation command share. The engine does the swap and the mate
classification (brep_render::engine_state::replace_component).
Structs§
- Candidate
- One offered replacement.
- Preview
- What replacing
component_idwithcandidatewill do, BEFORE it is done. - Replace
Dialog - The Replace component window.
openit on an occurrence; it shows the chooser, runs the replace, then the summary of what happened to the mates until the user closes it. Reopened with no target (Self::review) it is the summary alone, for mates still held from an earlier replace.
Enums§
- Replace
Source - What the occurrence is replaced WITH.
Constants§
- GROUPS
- Section titles, in the order the chooser shows them.
Statics§
- HIT_
KEYS - The hit keys this window publishes (see
automation::hit_keys).
Functions§
- accept_
suggestions - Accept every PRE-TICKED suggestion of the given held mates (every held
mate, at every depth, when
idsis empty) as one undo step. - candidate_
matches - Whether
candidatematches what the user typed: its label, its store name, and in a PLM session the part number and name the index holds for it. Case-insensitive; an empty filter matches everything. - candidates
- The candidates for replacing
component_id, best first: other members of its family (when it is one; by row name), the other parts this assembly already carries, the part files beside it (its folder, or the PLM workspace a PLM store lists), recent files.browseadds every part file the store lists. The occurrence’s own part is never offered, and neither isexclude(the assembly being edited: it cannot contain itself). - delete_
held - Delete a held mate at any depth (one undo step).
- finish_
work_ part_ for_ replace - A replace edits the assembly, and a Work part edited in context couples its
part’s undo to the assembly’s: a part undo after the replace would undo the
REPLACE, and a push meant for the old part would land on whatever the
occurrence shows now. So when the active assembly hosts a Work part
session, the replace first finishes it (Return to assembly: its edits are
kept) and says so. Returns that line, or
Nonewhen no session was open. - held_
mates - Every mate a replace is holding, at every depth, as the top window lists
them. A top-level mate is the engine’s row. A mate inside a sub-assembly is
listed per occurrence path of that sub-assembly: its id is
<occurrence path>:<constraint id>(ACOMP1:CONC1) and its refs are namespaced the same way (ACOMP1:ACOMP1:Hole_S), with its suggestion chosen and ticked from the new part’s geometry exactly as at the top. - held_
summary - What the Constraints pane says about held mates,
(count, wording), kept incacheper history revision.held_matesclones the whole parts library and walks every nested definition (~5 ms a frame on l500); the count and the wording read only the document, never the suggestions that follow the scene, and every document write moves the revision (undo and redo included). - instances_
of - Every ACOMP occurrence that shows the same part as
component_id(itself included), in history order — the “Replace all instances of<part>” set. - pattern_
line - What a Pattern Component makes of replacing
seed: opened on one of its instances (instance: the instance id, its pattern and number), why the chooser shows the seed; else how many instances follow it.Nonewhen no pattern is seeded by it. - preview
- The preview for
candidate(lineage against the occurrence’s current part, the mates it touches, the candidate’s document).Nonefor an unknown component. - repair
- Repair held references at any depth, as ONE undo step:
(mate id, old ref, new ref)with the ids and refsheld_mateslists. A nested mate’s new ref must lie inside the same sub-assembly. A mate with nothing left held is re-enabled (if it was enabled before) and loses its marker. - replace
- Replace the part shown by
component_idswithsource. One undo step; the mates’ report lands with the run (EngineState::replace_report). Returns the new parts-library entry name. - replace_
nested - Replace a part placed INSIDE a sub-assembly, from the top assembly.
pathis the occurrence path (ACOMP3:ACOMP1: the top occurrence, then the placement inside its definition, at any depth). The sub-assembly’s definition is edited, so every placement of that sub-assembly follows, and a Save writes it into the sub-assembly’s own file. Withall_instances, every placement of the same part in that sub-assembly is replaced. Mates inside the sub-assembly are held (disabled, marked) when the parts share no lineage, exactly as at the top; the top assembly’s mates on the replaced part go through the usual classification. One undo step. - search_
candidates - The chooser’s list for what was typed: the usual sections when nothing is, and EVERY part the store lists (other folders, the whole PLM index) narrowed to the matches once something is, with no Browse click.