TheSwamp
Code Red => .NET => Topic started by: Andrey Bushman on September 02, 2010, 09:44:21 AM
-
AutoCAD 2009 Enu x86 SP3;
.Net Framework 3.5 SP1;
I get error in last string of my code: "Keywords are not allowed."
PromptStringOptions pso = new PromptStringOptions("What to do with csv-file?");
string value = "Override";
pso.Keywords.Add(value, value, value, true, true);
value = "Change";
pso.Keywords.Add(value, value, value, true, true);
pso.AppendKeywordsToMessage = true;
pso.AllowSpaces = false;
pso.DefaultValue = pso.Keywords[0].DisplayName;
PromptResult pr = ed.GetString(pso);//ed -> Editor
In what my mistake?
-
I can use it:
PromptKeywordOptions pko = new PromptKeywordOptions("\nWhat to do with csv-file? ");
pko.Keywords.Add("Override");
pko.Keywords.Add("Change");
pko.AllowNone = false;
PromptResult pKeyRes = ed.GetKeywords(pko); ;//ed -> Editor
But in this code I can't set default value.
-
I can use it:
PromptKeywordOptions pko = new PromptKeywordOptions("\nWhat to do with csv-file? ");
pko.Keywords.Add("Override");
pko.Keywords.Add("Change");
pko.AllowNone = false;
PromptResult pKeyRes = ed.GetKeywords(pko); ;//ed -> Editor
But in this code I can't set default value.
Hi Andrey,
set AllowNone to true, default is when StringResult is empty. Much better to signal your status out of band.
Cheers, Thorsten