.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting keywords with mouse working and perhaps auto-complete

4 REPLIES 4
Reply
Message 1 of 5
namin
344 Views, 4 Replies

Getting keywords with mouse working and perhaps auto-complete

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?
4 REPLIES 4
Message 2 of 5
Anonymous
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?
Message 3 of 5
namin
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.
Message 4 of 5
Anonymous
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.
Message 5 of 5
namin
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost