Many times user needs to find components/sub-assemblies/assemblies from bulk parts in a directory. So using existing "ugpc” utility and below batch script, now more consolidated report in .csv file format is generated. This script also loops through all parts in sub-directories.
Steps to run batch script:
Create a file with .bat extension and copy-paste below text and save it.
echo "Part name along with path","Part Name","Conponent count" >> Output.csv
set /p id="Specify directory to scan: "
(For /R %id%\ %%G IN (*.prt
) do For /f %%A in ('ugpc %%G ^|C:\Windows\System32\find.exe /i /c ".prt"') Do Echo(%%G,%%~nxG,%%A
) >> Output.csv
Launch NX cmd (command prompt).
Drag-drop above file in cmd and hit enter button.
It will ask directory to be scanned for part files. Specify it in cmd and hit enter.
csv in below format will be created at the end of script run. Apply filter to last column to find desired parts.