[quote user="Toby77"]My question is how do I select and element and assign a different (unique) MSLINK to it, without having to change the code each time? [/quote]
Have you succeeded in connecting your app. to an external database?
Your DGN elements have an ID (MSLINK) that identifies the row in a table in your database. Query the database table for the highest MSLINK value, then increment that and create the new element linkage.