Private Sub CommandButton1_Click() Call 画圆1 End Sub Private Sub CommandButton2_Click() Unload Me End End Sub Public Sub 画圆1() Dim cir1 As AcadCircle Dim center1(0 To 2) As Double Dim r1 As Double center1(0) = Val(TextBox1.Text): center1(1) = Val(TextBox2.Text): center1(2) = 0 r1 = Val(TextBox3.Text) Set cir1 = ThisDrawing.ModelSpace.AddCircle(center1, r1) If ComboBox4.Text = "红" Then cir1.color = 1 ElseIf ComboBox4.Text = "黄" Then cir1.color = 2 ElseIf ComboBox4.Text = "绿" Then cir1.color = 3 Else: cir1.color = 7 End If cir1.Update 'ZoomAll ThisDrawing.Regen acAllViewports End Sub Private Sub UserForm_Click() End Sub Private Sub UserForm_Initialize() ComboBox4.AddItem "黄" ComboBox4.AddItem "绿" ComboBox4.AddItem "红" End Sub
[此贴子已经被作者于2006-10-6 15:43:03编辑过] |