GetString is only for returning a string as input, like the a date or filename. For a command prompt, you use the GetKeyword function along with InitializeUserInput. Below is a sample of how to get and test the result. If you format your prompt string according to standard AutoCAD prompting, your keywords will automatically appear as links in the command line. Note the use of spaces, brackets and slashes.
Public Sub DeleteAllPSLayouts()
'Deletes all paperspace layouts, leaving
'a blank Layout1.
'The model space tab cannot be deleted.
Dim lyt As AcadLayout
Dim Response As String
Dim KeyWords As Variant
KeyWords = "Yes No"
ThisDrawing.Utility.InitializeUserInput 6, KeyWords
Response = ThisDrawing.Utility.GetKeyword(vbCrLf & "Are you sure you want to delete all layouts? [Yes/No] : Yes")
If Response = "Yes" Or Response = "" Then
For Each lyt In ThisDrawing.Layouts
If lyt.ModelType = False Then
lyt.Delete
End If
Next lyt
End If
End Sub
Ed
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to
post your code.