-
I guess where is a mistake there
You need to pass the first point twice!
See how this will be works for you
[vba]
Option Explicit
'' Solved
'' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~''
'' Getpoint loop example by TT (Tony Tanzillo)
'' request check "Break on Unhandled Errors" in General options
'' on Error Trapping Frame
Sub ClipExample()
Dim oEnt As AcadEntity
Dim oImage As AcadRasterImage
Dim ptArr() As Double, varPt As Variant
Dim i As Integer, j As Integer
Dim Msg As String
ThisDrawing.Utility.GetEntity oEnt, varPt, "Select image"
If TypeOf oEnt Is AcadRasterImage Then
Set oImage = oEnt
End If
Msg = vbCrLf & "First point: "
Dim MyPoint As Variant
j = 0: i = 0
Do While i < 6
i = i + 1
On Error Resume Next
MyPoint = ThisDrawing.Utility.GetPoint(, Msg)
If Err Then
Err.Clear
Exit Do
Else
ReDim Preserve ptArr(j + 1)
ptArr(j) = MyPoint(0): ptArr(j + 1) = MyPoint(1)
j = j + 2
End If
On Error GoTo 0
Msg = vbCrLf & "Next point or ENTER to exit: "
Loop
On Error GoTo 0
j = UBound(ptArr) + 2
ReDim Preserve ptArr(j)
ptArr(j - 1) = ptArr(0): ptArr(j) = ptArr(1)
oImage.ClippingEnabled = True
oImage.ClipBoundary ptArr
ThisDrawing.Regen acActiveViewport
End Sub
[/vba]
~'J'~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules