I have an assembly with over 1000 components, and I must read the entire structure (all level sub-assemblies and parts). But then, during the read, the Creo runs generate at every level. The overall structure read goes beyond 15 minutes. And there are cases I have to parse Assemblies beyond 1000 components, which makes it impractical to use the custom program.
Is there a way to disable generate programmatically during the assembly read?
subComponents = currentComponent.ListFeaturesByType (False,
If subComponents IsNot Nothing Then
For Each subCompItem In subComponents
ReadAssemblyStructure(creoSession, currentLevel, assemblyObj, childNode,
Just a stab in the dark as I haven't done any VB code with Creo... but I have done some scripting with SolidWorks (and they share a lot of similarities).
In SolidWorks, there were methods for getting an assembly's dependencies without even opening the file. Might be something worth investigating. I think the limitation is that you can get dependencies only, not an actual structure with quantities. Not sure if that would meet your requirements, but it would be much, much faster to run if the assemblies don't need to be opened.
As far I know there is no need to regen if you get the structure, because it is in memory. But if you get a member make sure to check the status. Only active components should be parsed, ignore for example suppressed once. If you don’t do this you may force to open components or family table member. Your code example does not show this, as far I understand VB.