Problem with Prompt Keywords

Problem with Prompt Keywords

Anonymous
Not applicable
739 Views
2 Replies
Message 1 of 3

Problem with Prompt Keywords

Anonymous
Not applicable
Hi All,

I was just making a user prompt prcedure, but faced a strange problem. when I add Keywords to my prompt options, the code doesn't work at all.
This is the code:

Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

Dim prpipedata As PromptStringOptions = New PromptStringOptions("Select Property")
Dim prpipedata_res As PromptResult = Nothing

prpipedata.Keywords.Add("Label")
prpipedata.Keywords.Add("Section")

prpipedata_res = ed.GetString(prpipedata)

If prpipedata_res.Status = PromptStatus.Cancel Then
MsgBox("Error: user cancelled")
Else
MsgBox(prpipedata_res.StringResult)
End If

This code works well only when I eliminate the two lines which assign keywords to the Prompt Options, can anybody help?
0 Likes
740 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
In the PromptOptions.SetMessageAndKeywords(..., ...) method's doc says:
"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 ("/")."
So it may work if you replace the string "Select Property" with the following string:
"Select Property[Label/Section]"
I' don't have access to VS right now so I can;t test it, but try it.
0 Likes
Message 3 of 3

Anonymous
Not applicable
Keywords with GetString() ?

If you want to obtain only keyword input, then
you use GetKeyword(), not GetString().

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5513769@discussion.autodesk.com...
Hi All,

I was just making a user prompt prcedure, but faced a strange problem. when I add Keywords to my prompt options, the code doesn't work at all.
This is the code:

Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor

Dim prpipedata As PromptStringOptions = New PromptStringOptions("Select Property")
Dim prpipedata_res As PromptResult = Nothing

prpipedata.Keywords.Add("Label")
prpipedata.Keywords.Add("Section")

prpipedata_res = ed.GetString(prpipedata)

If prpipedata_res.Status = PromptStatus.Cancel Then
MsgBox("Error: user cancelled")
Else
MsgBox(prpipedata_res.StringResult)
End If

This code works well only when I eliminate the two lines which assign keywords to the Prompt Options, can anybody help?
0 Likes