without seeing your code I'd be guessing ...
this works for me, as per the attached piccy;
//-------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
using AcDb = Autodesk.AutoCAD.DatabaseServices;
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcRx = Autodesk.AutoCAD.Runtime;
public partial class TestCommands
{
[AcRx.CommandMethod("kwp01")]
public void KeyWordPrompt01()
{
Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;
PromptKeywordOptions prKwOpt = new
PromptKeywordOptions("\nSelect Option");
prKwOpt.Keywords.Add("None");
prKwOpt.Keywords.Add("First");
prKwOpt.Keywords.Add("Second");
prKwOpt.Keywords.Add("Both");
PromptResult prKwOptRes = ed.GetKeywords(prKwOpt);
if (prKwOptRes.Status != PromptStatus.OK)
return;
ed.WriteMessage(prKwOptRes.StringResult.ToString());
}
}
//-------------------------------
wrote in message news:5883174@discussion.autodesk.com...
Thanks for your reply and your example.
I did try something similar to what you show.
I also did Editor.GetKeywords(message, keywords)
where keywords is a string[] of all the keywords I want -- I don't want it
to be flexible, I want the user to select just one of the given option.
However, I find it very inconvenient that with the above, the user has to
type the keyword in full: he cannot use tab to auto-complete. The keywords
appear in the mouse menu on a right-click, but clicking on any keyword
doesn't seem to do anything.
Is there some setting somewhere for the mouse menu to actually do something?
AutoCAD's primitives work just fine.