Hello everybody......
I need your help...
I have an assembly... which have some sub-assembly...
I used the code for calling the main assembly...
Form1.ofd.Filter = "SW Assembly (*.SLDASM)|*.SLDASM"
Form1.ofd.ShowOpen
fileAsm = Form1.ofd.FileName
Set swApp = CreateObject("SldWorks.Application")
swApp.OpenDoc6 fileAsm, 2, 0, "", fileerror, filewarning
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeature
Set swAsmDoc = swApp.ActiveDoc
Form1.ofd.Filter = "Text file (*.txt)|*.txt"
Form1.ofd.ShowSave
newFile = Form1.ofd.FileName
Open newFile For Output As fh
Write #1, "File = " & swModel.GetPathName
Here we will get the assembly file's directory....and next i used this below code to get each component from the assembly file..
Set swSelMgr = swModel.SelectionManager
Set swComp = swSelMgr.GetSelectedObjectsComponent3(1, 0)
Set swCompModel = swComp.GetModelDoc
Set swCompModel = swApp.ActivateDoc2(swCompModel.GetPathName, True, nRetval)
Write #1, "******* Comp = " & swComp.GetPathName
But if the assembly file have sub-assembly it just show the sub-assembly as one component....
Can any one tell me the code how to call those components inside the sub-assembly by calling only the main assembly?
with regards,,,
Borad
NITW
Thanks in advance....
SolidworksApi macros