Get all of objects including hidden and visible

What method should I use to get access to all of the hidden and visible objects of any type?

Thanks in advance.

The part object has several collections of object types (.Bodies, .Datums, .Curves, etc). You can iterate through these collections to get access to all of the object types whether the object is displayed or not.

Thanks for your comment.

In an assembly with some components and sub-assemblies, I can access all of the objects of the assembly prt using the collections of the "partWork" (variable defined as follow) just like yo said:

NXOpen.Part partWork = theSession.Parts.Work;

However, I am not able to access the objects of the child components and assemblies. How can I do that please?

You can find an article here that explains how to process all the components of a given assembly.

http://nxjournaling.com/content/creating-subroutine-process-all-componen...

If you have a reference to a component object, you can get a reference to its prototype part with the following:

{component}.Prototype.OwningPart