Scope: Schematic editor
Object: Block Object
Prerequisites: None
Exchanges one or more components with a different component and preserves the REFDES.
Block.ChangeComponentPreserveRefdes(ByVal OldComp As String, ByVal NewComp As String) As Boolean
Name of the component to be replaced. The special string "< Selected Components >" will cause all the components on the selected list to be replaced by the new component.
Name of the component which replaces OldComp.
The special string "< Selected Components >" causes all the components on the selected list to be replaced by the new component.
This method returns True if the component was replaced, or False if the component could not be replaced. False throws an Automation exception if the special string is used and there are not any components on the selected list.
Replace all components while preserving the REFDES.
ActiveView.Block.ChangeComponentPreserveRefdes "< Selected Components >", "0805cap.1"
'Replace all capacitors with surface mount version
ActiveView.Block.ChangeComponent "cap.1", "0805cap.1"