 - Option Explicit
- Public Sub SelectSinglePLine(returnObj As AcadPolyline, _
- basePnt As Variant, _
- blnESC As Boolean)
-
- On Error Resume Next
- 'If ThisDrawing.GetVariable("cmdactive") Then ThisDrawing.SendCommand "(command)" & vbCrLf
- ' The following example waits for a selection from the user
- RETRY:
- ThisDrawing.Utility.GetEntity returnObj, basePnt, "请选择任意一条多线段:"
-
- 'Debug.Print Err.Number, Err.Description
- If Err.Number = -2147352567 Then
- blnESC = True
- Exit Sub
- End If
-
- If Err <> 0 Then
- Err.Clear
- GoTo RETRY
- Else
- returnObj.Highlight True
- 'MsgBox "The object type is: " & returnObj.EntityName, , "GetEntity 示例"
- ' returnObj.Update
- End If
-
- End Sub
- Public Sub ss()
- Dim returnObj As AcadPolyline, basePnt As Variant, blnESC As Boolean
- SelectSinglePLine returnObj, basePnt, blnESC
- Debug.Print returnObj.Area
- End Sub
我用vba测试,没有任何问题呀 |