Quantcast
Channel: NX Journaling - Journaling / NXOpen API
Viewing all articles
Browse latest Browse all 783

NX Journal Python:: Creating List of All Components Loaded Into an Assembly

$
0
0

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


Viewing all articles
Browse latest Browse all 783

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>