Hi,
I am facing one challenge in my task, I am actually upgrading our Tools from MDL C to C#.
My task is I wanted to change the Value of Text Elements. I have achieved it, with the help of one of article in community, which is below.
But however I am facing some issues.
Here is my example. I am accessing TXTPROJNAME from DGN file and want to change its Value.
ModelElementsCollection graphicEls = scanModel.GetGraphicElements();
Bentley.DgnPlatformNET.Elements.TextElement txts = new Bentley.DgnPlatformNET.Elements.TextElement();
if (ele.Description.Contains("TXTPROJNAME ")) // ele is a TextElement
{
Bentley.DgnPlatformNET.TextBlock newTxtBlck = new Bentley.DgnPlatformNET.TextBlock(styleNone, activeModel);
newTxtBlck.AppendText("Test");
textEdit.ReplaceTextPart(textPartId, newTxtBlck) // using to change the value
Currently I am using Description attribute to refer the element.
when I change the value of Text element, Value and Description both are changing. And next time I am unable to access the same element by using previous description.
I think using of Description is not correct to refer the Element. Please suggest.
I hope you you understood my issue.
Please help on this issue.
Thanks,
Varsha