Modify existing view template

Modify existing view template

mrensing
Enthusiast Enthusiast
1,328 Views
1 Reply
Message 1 of 2

Modify existing view template

mrensing
Enthusiast
Enthusiast

I thought I was going about this the correct way, but since I am here and posting, it isn't working out the way I thought it should.

 

I have a class storing the ElementId and bool value for the visiblity of imported DWG layers. That class is below

public class CategoryVis
{
  public ElementId Id { get; set; }
  public bool Visibility { get; set; }
}

 

The tranaction I am using to update the View Template is:

using (Transaction transaction = new Transaction(this.doc, "Transfer DWG Visibility Settings"))
{
  transaction.Start();
  foreach (importedDWG imp in sourceImports)
  {
    foreach (CategoryVis categoryVis in imp.categoryVis)
    {
      view.SetCategoryHidden(categoryVis.Id, categoryVis.Visibility);
    }
  }
  transaction.Commit();
}

 In the code above, view is the View Template.  When I run this code, nothing happens.  There is no command listed in the undo list, and the view template has not been modified. What am I missing to update this view template?

0 Likes
Accepted solutions (1)
1,329 Views
1 Reply
Reply (1)
Message 2 of 2

mrensing
Enthusiast
Enthusiast
Accepted solution

So, a fresh look at it on Monday reveals that I was not choosing the correct View template to read from 

0 Likes