AnsweredAssumed Answered

SolidWorks assembly does not recognize sub-assemblies unless they are opened prior

Question asked by Andrew Overby on Jan 15, 2019
Latest reply on Jan 17, 2019 by Andrew Overby

Currently, I am having an odd issue with my SolidWorks macro. Essentially, it is a part number generator that uses an external file to reference a part number data sheet and assigns properties based on what it retrieves. It also recognizes whether or not the part is Purchased, Manufactured, or 3D Printed based on the feature folder it is in. In order to limit the amount of time that this outside file is being referenced to hand out new part numbers, there is a process that goes through the root assembly and figures out how many of each (Purchased, Manufactured, or 3D Printed) there are. However, when running the process, it only returns the correct number of components if you are to open the sub assemblies and then go back to the root assembly, initiating the macro. By doing this, it will return the correct number of components; however, if you do not (open the root assembly and start the macro without opening the other sub assemblies), it will only return what is in the root. It is weird to me because it goes through the recursion after the sub-assemblies are opened but they are unrecognizable beforehand. Is this a bug or am I missing something that is key here? Thanks for the help in advance!

Outcomes