Hi Everyone,
I want to prompt user with multiple options,
(i.e) User can either select polyline or even enter a keyword to proceed with further operations.
I have used below code to prompt
int stat = acedEntSel(_T("\nDefine next window or enter 'RM' to define next room or enter 'X' to exit definition[RM/X]"), ent, pt);
if (stat != RTNORM && stat != RTKWORD)
{
}
While debugging when I enter any keyword, it's not returning any keyword,
Can anyone please advise, what needs to change to achieve the required result.
Thanks in advance.
Solved! Go to Solution.
Solved by tbrammer. Go to Solution.
If you want to allow keywords you must call acedInitGet() first:
int val=RSG_NONULL; // see docs for acedInitGet() for possible values.
acedInitGet(val, L"RM eXit");
int stat = acedEntSel(_T("\nDefine next window or enter 'RM' to define next room or enter 'X' to exit definition [RM/X]"), ent, pt);
if( stat==RTKWORD ) {
TCHAR userstring[512];
if (acedGetInput(userstring) == RTNORM) {
// Now userstring is one of the keywords passed to acedInitGet().
}
}
In your case I would use
stat = acedEntSel(_T("\nSelect next window or [next Room/eXit]"), ent, pt);
So the user only needs to type 'R' or 'X' or click on one of the options.