Hi there,
I fear I have to bother you with a very stupid question.
I’ve been trying to change a TextDot’s Text for one evening now and I don’t know how to move on.
Here is a snippet of my code:
Out of a list of RhinoObjects I try to do the following:
foreach (var subitem in Issues)
{
var TDot = subitem.Id;
var IssueDot = new ObjRef(Dot).TextDot();
IssueDot.Text = "XXXXXXXX";
IssueDot.SecondaryText = "XXXXXXXXXXX";
subitem.CommitChanges();
}
I will have to create the object, representing the Object from Rhino by it’s Id.
If I print the TextDot’s Text, it’s printed and everything’s fine.
I guess the problem is the way I try to change the text, right?
yes, perfect.
I investigated that issues this evening and I got the idea that I might have to replace the object, could not figure out how to do that, though.
I fear it’s not working in my case.
I am getting values from a DGV and wanna compare them to the values in the dots.
The values I write into them right now are simplifyed to make things more abstract.
The thing is you did the code for a command, but I am using a class for that.
But that should not be a problem, right?
public void UpdateItems(DataGridView IssueList)
{
var Issues = GetItemsFromLayers();
for (int i = 0; i < IssueList.Rows.Count - 1; i++)
{
foreach (var subitem in Issues)
{
var text_dot = subitem.Geometry as TextDot;
var dupe_dot = text_dot.Duplicate() as TextDot;
dupe_dot.Text = "XXXX";
dupe_dot.SecondaryText = "XXXXXXX";
Rhino.RhinoDoc.ActiveDoc.Objects.Replace(subitem.Id, dupe_dot);
}
}
}