Author Topic: Keywords are not allowed  (Read 2887 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Keywords are not allowed
« 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."
Code: [Select]
               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?
« Last Edit: September 02, 2010, 09:48:36 AM by Andrey »

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: Keywords are not allowed
« Reply #1 on: September 02, 2010, 10:06:50 AM »
I can use it:
Code: [Select]
                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.

kaefer

  • Guest
Re: Keywords are not allowed
« Reply #2 on: September 02, 2010, 10:20:49 AM »
I can use it:
Code: [Select]
                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