Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8684

Delete or Purge Reference Layer in C#

$
0
0

I have created a Reference layer to show debug values for a command I am writing.
I use reference layers because they are not saved with the document.

I am trying to write another command to clear these layers.

success = true;
foreach (var reference in doc.Layers.Where(l => l.IsReference).ToList()) {
success = success && doc.Layers.Purge(reference.Index, true);
}

if (!success) {
Log.Warning(“Failed to clear managed Layers”);
}

However this code never succeeds - any clues why?

7 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 8684

Latest Images

Trending Articles



Latest Images