Strange behaviour with DBText selected by application

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have written an application where I it creates a polyline and DBTexts positioned along the polyline at an equal interval . The Polyline and the DBText are linked so that every time I modify the polyline the changes are also reflected on the DBTexts (number of DBTexts depends on polyline length so each time a polyline is changed, all DBTexts are erased and recreated). All of this works with no problems.
Now I wanted to add a feature so whenever I select the polyline, all DBTexts gets selected as well.. I managed to do this and it's all working except if the polyline is already selected and it gets grip stretched I start to get some weird behaviour where the DBText look normal (unhighlited in color) except it show its alignment grip in the right position and its insertion grip at the origin (0,0,0).
If I do a REGEN manually, things get corrected, but if I add a regen() in the application things become worse.
The program maintains a list of all created DBText, so when a stretch grip happens, all DBTexts are erased after a list of their objectId is saved in 'Erased' list and new DBTexts are created.
the code to select the newly created DBText is below. Basically all it does is filter out the erased DBTexts and remove the associated polyline from the selected list that the program maintains to know which polyline is selected. This will trigger ImpliedSelectionChanged() Event which will just select the polyline and its associated DBText objects
PromptSelectionResult CurrentSelection = doc.Editor.SelectImplied(); if (CurrentSelection.Status == PromptStatus.OK) { if (CurrentSelection.Value.Count > 0) { Global.SelectedPolys.Remove(Poly.ObjectId); ObjectId[] NewSelection = CurrentSelection.Value.GetObjectIds(); List<ObjectId> NewSet = new List<ObjectId>(); int Count = 0; while (Count < NewSelection.Length) { if (!Erased.Contains(NewSelection[Count])) NewSet.Add(NewSelection[Count]); Count++; } doc.Editor.SetImpliedSelection(NewSet.ToArray()); }
}
Any thoughts on why this happens? and/or how to get rid of this?