Hello @PACOSPHARM
So the easiest thing I think in this case is to go through the Solidworks Task Scheduler to make a bulk addition of a custom property to the very many parts, then to sort the bills of materials based on the value of this property.
1: Open the Solidworks Task Scheduler (start menu > all programs > SOLIDWORKS Tools > SOLIDWORKS Task Scheduler)
2: In the side panel, choose Update Custom Properties
3: In the dialog box, click on the Add File button... select all the parts A and then open
4: Click the Next button
5: In the Name column type the word sort, in the Type column choose Number, and in the Value column type the number 100 and then click the Finish button to run the task.
6: Repeat steps 2 to 5 for P parts with the value 200
7: Repeat steps 2 to 5 for C parts with the value 300
8: Repeat steps 2 to 5 for V parts with the value 400
When all tasks have completed their execution:
1: Open a Drawing
2: Insert a new column (on the right) to the BOM, then in the small menu that appears select Custom Property for Column Type, and in Property Name select sorting
3: Right-click on the BOM > Sort.
4: Sort by: sort. Check Croissant and Numeric Method, then OK
5: Finish by hiding the column: Right-click on the letter of the column "sort" > Hide > Column
That's it, you will now have the desired sort order.
Note: The 100-fold increment in the sort value assigned to the part types is not insignificant on my part. Unless you are absolutely certain that you will never have more than these 4 types of parts (APCV) to process, I recommend this system to make possible future insertions of new types more flexible. 99 new types can then be inserted between each. For example, if you have a new reference Y and you want to classify it between P and C, you assign it the intermediate sort value 250, thus leaving room between P and Y, and between Y and C. A new reference Z to be classified between P and Y will take the intermediate value 225. Etc. This system leaves a good deal of leeway before being forced to change sorting values that are already assigned. Of course, the higher the increment, the longer the system will be flexible.
Kind regards