I was originally planning to ask this question on the Bentley forums for programming as they had a similar answer for a C# question which I was using to model mine on. However, the account I created for the forums doesn't seem to be working.
The purpose…