I want to delete Node(Link) with .Net script.
When I switch to ‘Model’, it works.
But if I switch to other tab except ‘Model’, even if I set context, failed.
Is there any way to solve it?
Code:
private void deleteLink(ISimComponent component, List<string> linkList)
{
foreach (var link in linkList)
{
IoC.Get<IApplicationContext>().SetContext("Author");
component.RootNode.Children[0].Delete();
//component.FindNode(link).Dispose();
//component.FindNode(link).Delete();
//component.Rebuild();
//component.UpdateAttributes();
//component.Update();
//component.RootNode.Rebuild();
}
}
vcmx:
无属性装配组件.vcmx (48.3 KB)