I created a where used program (vb express 2010) about a year ago which does its job fairly well but is a bit slow. It seems a bit silly to ask this question without posting all my code but I'll try to give a detailed enough rundown to see if anyone has any suggestions on how to speed it up.
Program background:
1- Get all assembly files within a specified folder (ie: Z:\SOLID WORKS)
*2- Loop through all assembly files and use docmgr to grab child components (single level down only)
3- for each child component write line to database in memory(assy#, parent#)
4- once done, copy to stored database
-----
1- after db is established (either through rebuilding it as per above, or by loading from saved db)
2- search through database to find where used
3- if user specified, take results and do whereused search on them etc to go right to the top level assy
#2 is where i'm getting my speed issues. We currently have ~6500 assembly files and this update process takes about 20min to complete. What scares me is when I started this program (we were win xp 64bit, now win 7 64bit) we had ~6000 assy files and the update would take 15min. I don't want to get to the point where 2 years down the road with 8000assy files it takes 2h45min to complete.
with each returned assembly file path I have attempted to get the child components by 2 methods:
config = swDMDoc.ConfigurationManager.GetConfigurationByName(configName) SubCompArray = config.GetComponents & config.GetReferencesInformation2(SubCompArray, SubCompConfigNames, SubCompSStates, SubCompIsVirtual) GetComponents(20min) seems to be quicker than GetReferencesInformation2(30min). In steping through the program there isn't really any noticable "lags" (on average is doing 5.4 assemblies/second). Anyone else taken on a similar project and had any breakthroughs in efficiency?
SolidworksApi macros