|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > CADSystem > SWReplaceReferencedConfiguration |
available from build: 20090710 |
The command replaces in a SolidWorks assembly file a specific configuration of a component with another configuration of a different component.
call DBWShell("SWReplaceReferencedConfiguration asmPath asmCfg componentToBeReplacedPath componentToBeReplacedCfg ReplacingComponentPath ReplacingComponentCfg")
asmPath |
the containing assembly path |
|---|---|
asmCfg |
the containing assembly configuration |
componentToBeReplacedPath |
the path of the component to be replaced in the assembly |
componentToBeReplacedCfg |
the specific configuration of the component to be replaced in the assembly |
ReplacingComponentPath |
the path of the replacing component in the assembly |
ReplacingComponentCfg |
the specific configuration of the replacing component in the assembly |
This command is available for Solidworks files only.
In this assembly A1 I need to replace the reference on P01 with a refrence on P03: 
sub main()
DBWinit(TRUE)
asmPath = "z:\FILES\HVE\case60859\60859_A1.SLDASM"
asmCfg = "Default"
componentToBeReplacedPath = "z:\FILES\HVE\case60859\60859_P01.SLDPRT"
componentToBeReplacedCfg = "Default"
ReplacingComponentPath = "z:\FILES\HVE\case60859\60859_P03.SLDPRT"
ReplacingComponentCfg = "Default"
DBWShell("SWReplaceReferencedConfiguration " & asmPath & " " & asmCfg & " " & componentToBeReplacedPath & " " & componentToBeReplacedCfg & " " & ReplacingComponentPath & " " & ReplacingComponentCfg)
DBWMsgBox "done"
end sub
The reference has been replaced: 