Message 1 of 13
Not applicable
06-29-2012
03:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hallo,
i have an problem with interaction between SendStringToExecute and SetImpliedSelection.
In following example work the SetImpliedSelection fine without the SendStringToExecute,
but with the SendStringToExecute do SetImpliedSelection nothing.
Why??
Code:
[CommandMethod("-SELTEST", CommandFlags.Transparent | CommandFlags.UsePickSet | CommandFlags.Redraw | CommandFlags.Modal)]
public void SELTEST()
{
Autodesk.AutoCAD.EditorInput.Editor acEditor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.
MdiActiveDocument.Editor;
Autodesk.AutoCAD.DatabaseServices.ObjectIdCollection acObjectIdCollection;
if (acEditor.SelectImplied().Value != null)
{
Autodesk.AutoCAD.EditorInput.PromptSelectionResult acPromptSelectionResult = acEditor.SelectImplied();
if (acPromptSelectionResult.Status == Autodesk.AutoCAD.EditorInput.PromptStatus.OK)
acObjectIdCollection = new Autodesk.AutoCAD.DatabaseServices.ObjectIdCollection(acPromptSelectionResult.Value.GetObjectIds());
else
acObjectIdCollection = new Autodesk.AutoCAD.DatabaseServices.ObjectIdCollection();
// 2 Elements remove from selection for Check
acObjectIdCollection.RemoveAt(0);
acObjectIdCollection.RemoveAt(0);
// ToArray
Autodesk.AutoCAD.DatabaseServices.ObjectId[] oIDArray = new Autodesk.AutoCAD.DatabaseServices.ObjectId[acObjectIdCollection.Count];
acObjectIdCollection.CopyTo(oIDArray,0);
// SendCommand (without this sendcommand work the SetImpliedSelection fine)
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute("_zoom _a ", false, false, false);
//Set SelectionSet
acEditor.SetImpliedSelection(oIDArray); // don't work
}
}
regards Mario
Solved! Go to Solution.

