Ah, thanks a lot! Less than one month of C# practice got me here.
The if(pEntRes.Status == PromptStatus.Keyword) is still needed of course, and the
do goes on top.
(no need to check for the .StringResult as I have only one Keyword.)
do
{
// Define the .GetEntity request.
pEntOpts
= new PromptEntityOptions
(Environment
.NewLine + "Select a line or a polyline or : ") { AllowObjectOnLockedLayer = true, AllowNone = true, AppendKeywordsToMessage = true };
pEntOpts.SetRejectMessage(Environment.NewLine + "Your selection must be a line or a polyline.");
pEntOpts.Keywords.Add("Settings");
...
// Ask the user to .GetEntity.
pEntRes = acDoc.Editor.GetEntity(pEntOpts);
if (pEntRes.Status == PromptStatus.Keyword)
{
// Change UserConfig
Interaction.UserConfig();
}
} while (pEntRes.Status == PromptStatus.Keyword);