AutoCAD 2013 can display keywords / subcommands as hyperlinks that can be selected using the mouse. In ObjectARX, for your keywords to appear as hyperlinks, simply add them to the prompt message within square brackets each separated by a forward slash. For ex : “Specify floor [ First / Second ]”
In AutoCAD .Net API, just adding keywords will make them appear as hyperlinks. You will not need to modify the prompt message.
Here is sample code using ObjectARX :
AcGePoint3d point;
int ret = RTNORM;
acedInitGet(RSG_NONULL, _T("First Second"));
ret = acedGetPoint
(
NULL,
ACRX_T("nSelect a point [First / Second]"),
asDblArray(point)
);
if (ret == RTKWORD)
{
TCHAR kw[20];
acedGetInput(kw);
acutPrintf(kw);
}
else if(ret == RTNORM)
{
acutPrintf(
ACRX_T
(
"nSelected Point : %lf, %lf, %lf"),
point.x,
point.y,
point.z
);
}
else
{
acutPrintf(ACRX_T("nNothing selected"));
}
Here is a sample code using AutoCAD .Net API :
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptPointOptions ppo = new PromptPointOptions("Pick a point ");
ppo.Keywords.Add("First");
ppo.Keywords.Add("Second");
PromptPointResult ppr = ed.GetPoint(ppo);
if (ppr.Status == PromptStatus.Keyword)
ed.WriteMessage(ppr.StringResult);
else if (ppr.Status == PromptStatus.OK)
ed.WriteMessage(ppr.Value.ToString());
else
ed.WriteMessage("Cancelled");

Leave a Reply to MartinCancel reply