Create,Rename and Update Revit ViewSection in C# grasshopper


I am trying to create revit section from rhino lines in grasshopper c# component.
I have successfully created ViewSection element, but

1.When i do changes in input values it doesn’t update but create new sections. Dynamo is able to do that but i don’t know how to incorporate this in grasshopper.

  1. I am not able to Set the ViewSection name.

Here is the code that i am using

//Creating Transaction
using (Transaction Trns = new Transaction(doc))
Trns.Start(“Create Section”);

  for(int i = 0; i < sectionBoxes.Count;i++)

    ViewSection section = ViewSection.CreateSection(doc, vft.Id, sectionBoxes[i]);
    section.Name = "newName" + i;  

section.Name is showing an error.
c# component error = 1. Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (line: 0)

but this the property which i used to change name in dynamo python.

Thank You