| Users Interaction |
|
|
|
| Tutorials | |||
|
Code can be pauzes to ask for users input. Or just create a whole new command that uses users interaction. The code below shows how intercation is made with the user to set the activelayer to a different color. [code] Sub Interact()
'****************************************
'*** Code from VisibleVisual.com ********
'**************************************** Dim StrColor As String
'Set the keywords
ThisDrawing.Utility.InitializeUserInput 0, "Blue Red Yellow Green"
'Send the command to the commandline and wait for return input
StrColor = ThisDrawing.Utility.GetKeyword(vbCr & "Enter text color[Blue/Red/Yellow/Green]:")
'Check the users input
Select Case Command
Case "Blue": ThisDrawing.ActiveLayer.color = acBlue
Case "Red": ThisDrawing.ActiveLayer.color = acRed
Case "Yellow": ThisDrawing.ActiveLayer.color = acYellow
Case "Green": ThisDrawing.ActiveLayer.color = acGreen
End Select
MsgBox "The activelayercolor has changed to " & StrColor
End Sub
[/code]
Download AutoCad sample Here
|



Comments
error
"Select Case Command"
correct
"Select Case StrColor"
RSS feed for comments to this post