<CommandMethod("TcDrawCircle")> _
Public Sub TcDrawCircle()
On Error Resume Next
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'在俯视平面建立圆
Dim C1 As Circle = New Circle()
C1.Center = GetPoint()
Dim V1 As Vector3d = New Vector3d(0, 0, 1)
C1.Radius = 100
C1.Normal = V1
AddEnt(C1)
'在前视平面建立圆
Dim C2 As Circle = New Circle()
C2.Center = GetPoint()
Dim V2 As Vector3d = New Vector3d(0, 1, 0)
C2.Radius = 1000
C2.Normal = V2
AddEnt(C2)
'在侧视平面建立圆
Dim C3 As Circle = New Circle()
C3.Center = GetPoint()
Dim V3 As Vector3d = New Vector3d(0, 1, 0)
C3.Radius = 1000
C3.Normal = V3
AddEnt(C3)
acTrans.Commit()
End Using
If Err.Number > 0 Then
MsgBox(Err.Description)
End If
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |