@@ -0,0 +1,1251 @@
+#! /usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A%0Aimport os%0A%0AinFile = %22UNIQUEBRICKS.TXT%22%0AdoNotExist = %5B%5D%0A%0Awith open(inFile, %22rt%22) as f:%0A    lines = f.readlines()%0A%0AbrickCount = 0%0Afor line in lines:%0A%0A    # Do not process comments or blank lines%0A    if not line.startswith(%22#%22) and line not in (%22%5Cr%22, %22%5Cn%22, %22%5Cr%5Cn%22):%0A        brickCount += 1%0A%0A        # Extract only the file path to the model, removing unneeded path%0A        line = line%5B:line.find(%22MD2%22) + 3%5D.split(%22%5C%5C%22)%5B3:%5D%0A%0A        # Construct the path to the 3D model%0A        modelPath = os.path.join(os.getcwd(), os.path.sep.join(line))%0A%0A        # The 3D model does exist, move along%0A        if os.path.isfile(modelPath):%0A            continue%0A%0A            # Nope, it does not exist%0A        else:%0A            doNotExist.append(os.path.sep.join(line))%0A%0A# Report the number of bricks%0Aprint(%22There are %7B0%7D bricks listed in %7B1%7D.%5Cn%22.format(brickCount,%0A      os.path.basename(inFile)))%0A%0A# Some 3D models do not exist, report them%0Aif len(doNotExist) %3E 0:%0A    print(%22Of the bricks listed, %7B0%7D do not exist. They are as follows:%22%0A          .format(len(doNotExist)))%0A%0A    for part in doNotExist:%0A        print(%22* %7B0%7D%22.format(part))%0A%0A# All models exist%0Aelse:%0A    print(%22All %7B0%7D bricks exist.%22.format(brickCount))%0A

Create LR2-Brick-Count.py