In trying to decide what element of CC3 XP programming I was going to blog about next, I started to re-read all of the old posts on the cc2-dev-l email list @ groups.yahoo.com.
Wow, I had forgotten how much valuable information was out there. If you have the time (And it will take a bit of time) just start at the beginning and read through the threads. I promise that you will learn something – I did!
I found a request by Linda Kekumu. It seemed that she had a large number of maps that had lots of Notes attached to them and they were wrong. She needed a quick way to clear out all the notes on a map, instead of manually removing them one at a time. Peter responded with this dash of code.
The reason I selected it for this post is that it is probably the smallest piece of code that displays how to use DLScan. Now DLScan does exactly as the name says, it scans the “Drawing List” (i.e. the drawing database) and calls a function for every “identified” element. I say “identified” because there are times when you only want to look at a subset of the entire Drawing List.
In this new XP command, we scan the Drawing List with the DLS_Std flag, telling DLScan that we want to scan the Drawing List for “all standard all non-erased elements”.
Then in our called function (ClearNotesScan) we check the EType of each identified element (pEntRec) . If the EType equals ET_Note, we know it is a Note and we call DLErase to remove the element from the Drawing List.
So, with this, you can now scan through a map and look at every identified element!