dchlmz 发表于 2005-11-14 10:32:00

请问如何在命令行交互输入字符串?

请问如何在命令行交互输入字符串?我想对某一层进行操作,用"Getstring",输入层名时总是出错。

sieben 发表于 2005-11-14 16:49:00

&ltRE class=Code>Utility.GetString&ltRE class=Code>AutoCAD里有帮助&ltRE class=Code>Sub Example_GetString()
    ' This example demonstrates different ways of returning a string
    ' entered by a user.
   
    Dim returnString As String
   
    ' Prompt & Input cannot contain blanks
    returnString = ThisDrawing.Utility.GetString(False, "Enter text (a space orterminates input): ")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
   
    ' Prompt & Input can contain blanks
    returnString = ThisDrawing.Utility.GetString(True, "Enter text ( terminates input):")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
   
    ' Prompt & Input can contain blanks, but not an empty string
    Dim NoNull As Integer
    NoNull = 1    ' Disallow null
    ThisDrawing.Utility.InitializeUserInput NoNull
    returnString = ThisDrawing.Utility.GetString(True, "Enter text ( terminates input): ")
    MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
End Sub

dchlmz 发表于 2005-11-15 13:22:00

谢谢
页: [1]
查看完整版本: 请问如何在命令行交互输入字符串?