Forums:
Hello all,
I have a quick question. Does anyone know how to construct an array of all components loaded into an assembly in NXOpen's Python API? Everything I have tried leads to the same error:
"TypeError: 'NXOpen.Assemblies.Component' object is not iterable"
I've tried code such as:
import NXOpen theSession = NXOpen.Session.GetSession() for x in theSession.Parts.Work.Bodies: if x.IsSolidBody: theBodyTags.append(x.Tag)
but this only gives me one component tag for some reason. Any help or insight on this issue would be greatly appreciated!
Thanks so much for your help!
Sam