Hi, I'm making my first moves in the world of add-ins for M9. I'm trying to open a form where the user can select e.g. which drawing to use (within the add-in). To get access to all the Manifold stuff I'm passing the Manifold.Context variable in the constructor (public static M.Context Manifold; and then in the Main function something like this: MyForm frm = new MyForm(Manifold);) The form opens perfectly, and in the constructor of the form I can access everything that the api exposes. private static M.Context _manifold; public TSPForm(M.Context manifold) { _manifold = manifold; // here I can access things e.g. Manifold.Application app = _manifold.Application; } But when I try to do this: private void button1_Click(object sender, EventArgs e) { M.Application app = _manifold.Application; using (M.Database db = app.GetDatabaseRoot()) { // this fails!!! } } it fails, although _manifold is not null. db appears to be null. Am I missing something here...? Thanks for some insight.
http://www.mppng.nl/manifold/pointlabeler |