.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug with AutoCAD 2007 and Editor.getKeywords()

2 REPLIES 2
Reply
Message 1 of 3
mario.rosenbohm
477 Views, 2 Replies

Bug with AutoCAD 2007 and Editor.getKeywords()

Hello,

I has a completely stupid effect with the inquiry of GetKeywords. the following code:




Dim acPromptResult As PromptResult

Dim acPromptKeywordOptions As PromptKeywordOptions

acPromptKeywordOptions = New PromptKeywordOptions("Select Point with

ick or with [Number]?")

acPromptKeywordOptions.Keywords.Add("P", "P", "P - pick")

acPromptKeywordOptions.Keywords.Add("N", "N", "N - Number/Name")

acPromptKeywordOptions.Keywords.Default = "A"

acPromptResult = acEditor.GetKeywords(acPromptKeywordOptions)



If (acPromptResult.Status = PromptStatus.OK) Then

If (acPromptResult.StringResult = "A") Then

...

...





starting from AutoCAD 2007 are indicated these inquiries also in the

indication/Modelbereich as Popupmenü.

But in this example only “A” and also not the display text stand in

the Popupmenü.

There does someone know an advice, or is at the end a nose?



Greeting Mario
2 REPLIES 2
Message 2 of 3

Sorry,



i have make one error by translating to english:



acPromptKeywordOptions.Keywords.Default = "A" is Wrong


the right Code is


acPromptKeywordOptions.Keywords.Default = "P"






And it is only the "P" on the popupmenu.
Message 3 of 3
Anonymous
in reply to: mario.rosenbohm

If I'm not mistaken, you've got wrong the PromptKeywordOptions constructor. In the Documentation, under the SetMessageAndKeywords topic says:
"This method sets the prompt message to the first part of the messageAndKeywords string and sets the display keywords to the latter part of the same string. The display keywords portion of messageAndKeywords must be surrounded by an opening square bracket ("[") at the beginning and a closing square bracket ("]") at the end. The keywords in this list must be delimited by a forward slash character ("/").Each display keyword specified in messageAndKeywords must also be matched by a keyword in the same position in the globalKeywords string. Keywords in globalKeywords must be delimited by a single space.If the bracketed keyword list is missing or empty, a System::ArgumentException is thrown. If the number of global keywords does not match the number of display keywords, a System::ArgumentException is thrown."

In your code, the display keywords part is missing. I think it should be something like:
"Select Point with Pick or with Number? [Pick/Number]"
You may have to use the globalKeywords parameter, too.

I may be totally wrong and the above doesn't apply to the PromptKeywordsOptions, but you could try it.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost