- UID
- 114966
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2004-3-18
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
在下面这个例子中,如何实现画线的顶点捕捉在物体???thanks very much!!!!!
Sub PlaceLine()
CommandState.StartPrimitive New clsPlaceLineCommand
End Sub
Implements IPrimitiveCommandEvents
Private m_atPoints(0 To 1) As Point3dPrivate m_nPoints As Integer
Private Sub IPrimitiveCommandEvents_Cleanup()
End Sub
Private Sub IPrimitiveCommandEvents_DataPoint(Point As Point3d, ByVal View
As View)
If m_nPoints = 0 Then
CommandState.StartDynamics
m_atPoints(0) = Point
m_nPoints = 1
ShowPrompt "Place end point"
ElseIf m_nPoints = 1 Then
m_atPoints(1) = Point
Dim oEl As LineElement
Set oEl = CreateLineElement1(Nothing, m_atPoints)
ActiveModelReference.AddElement oEl
oEl.Redraw
m_atPoints(0) = m_atPoints(1)
End If
End Sub
Private Sub IPrimitiveCommandEvents_Dynamics(Point As Point3d, ByVal View As
View, ByVal DrawMode As MsdDrawingMode)
If m_nPoints = 1 Then
m_atPoints(1) = Point
Dim oEl As LineElement
Set oEl = CreateLineElement1(Nothing, m_atPoints)
oEl.Redraw DrawMode
End If
End Sub
Private Sub IPrimitiveCommandEvents_Keyin(ByVal Keyin As String)
End Sub
Private Sub IPrimitiveCommandEvents_Reset()
CommandState.StartPrimitive Me
m_nPoints = 0
End Sub
Private Sub IPrimitiveCommandEvents_Start()
ShowCommand "VBA PlaceLine Example"
ShowPrompt "Select start of line"
End Sub |
|