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.......)
GetOperations
Moderators: remi77, jacs, Daniel
-
- Master Corporal
- Posts: 39
- Joined: Fri Oct 02, 2009 9:46 am
- TopSolid Module: TopSolid'Cam
- TopSolid Version: 7.8
- Location: Germany
GetOperations
Last edited by cam on Mon Aug 06, 2018 10:17 am, edited 2 times in total.
Greetings
Chris
Chris
-
- Master Corporal
- Posts: 39
- Joined: Fri Oct 02, 2009 9:46 am
- TopSolid Module: TopSolid'Cam
- TopSolid Version: 7.8
- Location: Germany
Re: GetOperations
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);
}
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);
}
Greetings
Chris
Chris