Here is update of ExportAV.lsp. Also attached is Excel template file ExportAV.xls.
IMPORTANT - the template file's location is set within ExportAV.lsp near the top. You MUST open ExportAV.lsp in a text editor (Notepad) and edit the path to template's saved location.
UPDATE NOTES:
1. Now gets TYPE data in this priority sequence:
a. from Attribute (tag "TYPE"), if not present...
b. from Visibility Parameter "Type", if not present...
c. from Visibility Parameter "Visibility1"
2. Now should count nested blocks accurately, including if nested 3 levels deep (this can be increased but the limit is set to avoid stack overflow due to unforeseen situations). You should know that block "systeemlijn" has (2) extra ID-100-255 blocks that are not visible in ANY visibility state. This will cause incorrect nested block count (too high). It will be important to avoid doing this for accurate counts.
3. Now opens directly in Excel to tab "Xdwgpos".
4. Now purges blocks at start of command, otherwise nested blocks in unreferenced block definitions could be counted
5. Now file name for spreadsheet is <drawing name>.xls with (#) added if file name exists.
Finally, given your latest example drawing, there are still two nested blocks with no "TYPE" indicator: ID-100-091 and ID-100-255 but I presume you know that.
Let me know how it goes.