.NET

.NET

Reply
Valued Contributor
namin
Posts: 55
Registered: ‎09-19-2006
Message 1 of 5 (103 Views)

Getting keywords with mouse working and perhaps auto-complete

103 Views, 4 Replies
03-22-2008 08:17 PM
When I use PromptKeywordOptions and then Editor.GetKeywords
I cannot select the options using the mouse in AutoCAD (it just doesn't do anything if I select one of my keyword with the mouse).
How can I get the mouse menu to work with the keywords?
Alternatively, is there a way to get auto-complete on the keywords?
*Kerry Brown
Message 2 of 5 (103 Views)

Re: Getting keywords with mouse working and perhaps auto-complete

03-22-2008 10:17 PM in reply to: namin
It's difficult to comment without seeing what you have actually tried ...

This may help : http://www.theswamp.org/index.php?topic=8063.0

you'll need to be registered to see the piccys showing the results though
[free membership]


wrote in message news:5883188@discussion.autodesk.com...
When I use PromptKeywordOptions and then Editor.GetKeywords
I cannot select the options using the mouse in AutoCAD (it just doesn't do
anything if I select one of my keyword with the mouse).
How can I get the mouse menu to work with the keywords?
Alternatively, is there a way to get auto-complete on the keywords?
Valued Contributor
namin
Posts: 55
Registered: ‎09-19-2006
Message 3 of 5 (103 Views)

Re: Getting keywords with mouse working and perhaps auto-complete

03-22-2008 10:32 PM in reply to: namin
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.
*Kerry Brown
Message 4 of 5 (103 Views)

Re: Getting keywords with mouse working and perhaps auto-complete

03-23-2008 12:39 AM in reply to: namin
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.
Valued Contributor
namin
Posts: 55
Registered: ‎09-19-2006
Message 5 of 5 (103 Views)

Re: Getting keywords with mouse working and perhaps auto-complete

03-23-2008 01:25 PM in reply to: namin
Hi Kerry,

Thanks very much, I figured it out. The keywords have to be capitalized in order for AutoCAD to treat them correctly!

Thanks again.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.