I am using DoAvaxAction to Mirror a set of objects. How do I get the handles of the mirrored objects? I expected OutHandles to have the new handles, but it is OutHandles is always equal to Nothing.
Page 1 of 1
DoAvaxAction Get new handles
#2
Posted 28 September 2009 - 08:50 AM
You can use the following VB6 code:
Private Sub Form_Load()
Dim vIn As Variant
Dim myAction As AvaxCommand
Dim fNewHandles As Boolean
Dim InHandles() As Long
Dim OutHandles() As Long
Dim vOut As Variant
Dim errCode As Long
Dim Answer As Boolean
Dim myMirror As AvaxMirror_t
Dim LastHandle As Long
Dim lCount As Long
ReDim InHandles(1) As Long
Call cAvax1.StartAvax
InHandles(1) = cAvax1.Add_Line(0, 10, 0, 5, 10, 0)
myAction = Mirror_c
myMirror.mirX1 = 0
myMirror.mirY1 = 0
myMirror.mirX2 = 10
myMirror.mirY2 = 10
vIn = myMirror
LastHandle = cAvax1.LastHandle
Answer = cAvax1.DoAvaxAction(InHandles, vIn, myAction, fNewHandles, OutHandles, vOut, errCode)
If Answer = True Then
If fNewHandles = False Then
If LastHandle < cAvax1.LastHandle Then
ReDim OutHandles(cAvax1.LastHandle - LastHandle) As Long
For lCount = 1 To cAvax1.LastHandle - LastHandle
OutHandles(lCount) = LastHandle + lCount
SwapLong OutHandles(lCount), InHandles(lCount)
Next lCount
End If
End If
End If
End Sub
Private Sub SwapLong(a As Long, B As Long)
Dim c As Long
c = B
B = a
a = c
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call cAvax1.EndAvax
End Sub
Athanasios Gardos
Avax-Software.com
Avax-Software.com
#4
Posted 01 October 2009 - 08:42 AM
This is the .net 2008 code example. We have tried it and it works fine.
Dim InHandles(2) As Integer
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Dim vIn As Object
Dim myAction As Avax.AvaxCommand
Dim fNewHandles As Boolean
Dim InHandles() As Integer
Dim OutHandles() As Integer
Dim vOut As Object
Dim errCode As Integer
Dim Answer As Boolean
Dim myMirror As Avax.AvaxMirror_t
Dim LastHandle As Integer
Dim lCount As Integer
ReDim InHandles(1)
Call CAvax1.StartAvax()
InHandles(1) = CAvax1.Add_Line(0, 10, 0, 5, 10, 0)
myAction = Avax.AvaxCommand.Mirror_c
myMirror.mirX1 = 0
myMirror.mirY1 = 0
myMirror.mirX2 = 10
myMirror.mirY2 = 10
vIn = myMirror
LastHandle = CAvax1.LastHandle
Answer = CAvax1.DoAvaxAction(InHandles, vIn, myAction, fNewHandles, OutHandles, vOut, errCode)
If Answer = True Then
If fNewHandles = False Then
If LastHandle < CAvax1.LastHandle Then
ReDim OutHandles(CAvax1.LastHandle - LastHandle)
For lCount = 1 To CAvax1.LastHandle - LastHandle
OutHandles(lCount) = LastHandle + lCount
SwapLong(OutHandles(lCount), InHandles(lCount))
Next lCount
End If
End If
End If
End Sub
Private Sub SwapLong(ByRef a As Integer, ByRef B As Integer)
Dim c As Integer
c = B
B = a
a = c
End Sub
Private Sub Form1_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
CAvax1.EndAvax()
End Sub
Page 1 of 1
Sign In
Register
Help
Add Reply

MultiQuote