Page 1 of 1

GetOperations

Posted: Thu Jul 13, 2017 11:57 am
by cam
Hi,

I get a "System.NullReferenceException" on

List<ElementId> ops = TopSolidCamHost.Operations.GetOperations(docID);

The docID is correct.

(Don't forget to Connect() to TopSolidCamHost.......)

Re: GetOperations

Posted: Mon Sep 11, 2017 11:39 am
by cam
No one an idee ????


This is my part of code, that doesn't work. It allways jump into "catch"

if (!TopSolidHost.Application.StartModification("My Action", false)) return;
try
{
TopSolidHost.Documents.EnsureIsDirty(ref docID);
if (TopSolidCamHost.Documents.IsCam(docID))
{
List<ElementId> ops = TopSolidCamHost.Operations.GetOperations(docID);
}
TopSolidHost.Application.EndModification(true, true);
}
catch
{
TopSolidHost.Application.EndModification(false, false);
MessageBox.Show("TopSolid modification READ failure", "WorkshopDocs -- Fehler", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
}