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

Is this still an issue? the duplication is because Element Binding as for the name change you may want to consider just changing it via the “set” parameter node. if it has to be contained within the c# code and if .name= is still not working for you you could try the builtinparameter method

Thanks for replying @msgambelluri .
though the project was paused due to some reason. so i never worked on it as there was no solution for this problem at that time.
I will try this method and will let you know if it works fine or not.