Before inserting any lines via AddElement(), the maximum number of lines that will be added needs to be declared via ReserveElements(). The actual number of lines that were added is available via NumElements().