Creigbm
Mechanical
- Aug 1, 2003
- 161
I am simply trying to write a macro that will replace components in an assembly. I tried recording a macro and doing some 'reverse engineering' on it but I keep on getting an error. Here is the code I am using:
Thanks in advance for any help.
Code:
Set Part = swApp.OpenDoc4("C:\Program Files\SolidWorks\data\Templates\DMAssembly.sldasm", 2, 0, "", longstatus)
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID("DM1-1@DMAssembly", "COMPONENT", 0, 0, 0, False, 0, Nothing)
Part.ClearSelection
Part.ReplaceComponents "Some File Name", "", False, 0, True
Thanks in advance for any help.