In my assembly file,there need three different nozzle,for example
named "N1","N2","N3", they all refer the same file "d:\nozzle\nozzle.sldasm"
before I insert the there nozzle to assembly,I must open it firist use ISldWorks::opendocumet6
I did like the following:
1. Set swmodel = swApp.OpenDoc6("d:\nozzle\nozzle.sldasm", 2, swOpenDocOptions_Silent, "", nErrors, nWarnings)
swmodel.SaveAs ("d:\example\N1.sldasm")
assembly.AddComponent4("d:\example\N1.sldasm", " " 0, 0, 0)
2. Set swmodel = swApp.OpenDoc6("d:\nozzle\nozzle.sldasm" 2, swOpenDocOptions_Silent, "", nErrors, nWarnings)
swmodel.SaveAs ("d:\example\N2.sldasm")
assembly.AddComponent4("d:\example\N2.sldasm", " " 0, 0, 0)
3. Set swmodel = swApp.OpenDoc6("d:\nozzle\nozzle.sldasm" 2, swOpenDocOptions_Silent, "", nErrors, nWarnings)
swmodel.SaveAs ("d:\example\N3.sldasm")
assembly.AddComponent4("d:\example\N3.sldasm", " " 0, 0, 0)
you can see ."Set swmodel = swApp.OpenDoc6("d:\nozzle\nozzle.sldasm" 2, swOpenDocOptions_Silent, part_conf, nErrors, nWarnings)" repeat 3 time!!
if the file "d:\nozzle\nozzle.sldasm" is large,It waste too much time.
I want to open the file only one time, then I can copymodeldoc 2 times, instead of open it there time, iIs there any mothod? or much easy mothod?
Yuan zhengjung
SolidworksApi macros