In an Autocad file, you can add properties such as nominal diameter, length, fittings  etc. After this, you can extract them and fill them into a table, and count them automatically.