Component total number of displaypart

Good evening
In for each from RootcComponent Child with a loop
I can count the total count of the component of displaypart,
Can you more easily get?

Looping through the assembly structure is a good way to get the component count.

An alternative method would be to shell out to the command line utility, "ugpc.exe", which will list the component references of a given part file. This method will be a bit more difficult as you will have to start an external program and manage its input/output.

Since UFAssem was also investigated but can not count the number of total
It will count in the assembly of the structure.
Thank you