Home AutoCad VB Users Interaction
20 | 05 | 2012
This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade

Users Interaction PDF Print E-mail
User Rating: / 0
PoorBest 
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   

 
0 #1 Guest 2012-01-11 01:52
There is an error in the code

error
"Select Case Command"

correct
"Select Case StrColor"
Quote
 

Add comment


Security code
Refresh

This site has been updated and renewed. You have followed an old link.

Click here to go to the new site

http://www.visiblevisual.com/jupgrade