iCAx开思工具箱

标题: 一个很郁闷的错误(vba开发cad一个小程序),大家看看。 [打印本页]

作者: sharksun    时间: 2004-3-19 01:42
标题: 一个很郁闷的错误(vba开发cad一个小程序),大家看看。
Private Sub CommandButton1_Click()
   Call DrawArc
   
End Sub
  
Private Sub DrawArc()
   Dim NewArcObj As AcadArc
   Dim Center As Variant, Radius As Double
   Dim StartAngle As Double, EndAngle As Double
      
   With ThisDrawing.Utility
      Center = .GetPoint(, vbCr & "Enter the center point OR Click on center point:")
      Radius = .GetDistance(Center, vbCr & "Enter the raduis:")
      StartAngle = .GetAngle(Center, vbCr & "Enter the start angle:")
      EndAngle = .GetAngle(Center, vbCr & "Enter the end angle:")
   End With
  
   Set NewArcObj = ThisDrawing.ModelSpace.AddArc(Center, Radius, StartAngle, EndAngle)
  
   NewArcObj.Update
   
End Sub
  
‘错误提示:autocad主窗口不可见。
说明:有人说要关闭程序窗口,我加了unload me , 也不好用
autocad版本为2004
  
谢谢指教。
作者: apple_bao_bao    时间: 2004-3-19 11:30
Private Sub CommandButton1_Click()
AutoCAD.Application.Visible = True‘该语句有没有都可以
UserForm1.Hide
   Call DrawArc
    
End Sub
  
Private Sub DrawArc()
   Dim NewArcObj As AcadArc
   Dim Center As Variant, Radius As Double
   Dim StartAngle As Double, EndAngle As Double
       
   With ThisDrawing.Utility
      Center = .GetPoint(, vbCr & "Enter the center point OR Click on center point:")
      Radius = .GetDistance(Center, vbCr & "Enter the raduis:")
      StartAngle = .GetAngle(Center, vbCr & "Enter the start angle:")
      EndAngle = .GetAngle(Center, vbCr & "Enter the end angle:")
   End With
  
   Set NewArcObj = ThisDrawing.ModelSpace.AddArc(Center, Radius, StartAngle, EndAngle)
  
   NewArcObj.Update
    
  
End Sub
作者: sharksun    时间: 2004-3-20 00:31
谢谢。




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3