Skip to main content

replace_nested

Function replace_nested 

Source
pub fn replace_nested(
    engine: &mut EngineState,
    store: &dyn ModelStore,
    path: &str,
    source: &ReplaceSource,
    all_instances: bool,
) -> Result<String, String>
Expand description

Replace a part placed INSIDE a sub-assembly, from the top assembly. path is 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. With all_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.