Hello,
i need some help with aucOpExecSheetCheckDropArea.
I want to check if the area where i want to drop a shape ist free befor the actual dropping but "
aucArgExecSheetRetVal" always return
. What am i doing wrong?
This ist my code: (DropShape works fine)
Private Sub mDropShape(oDevice As ObjectItem, oSheet As Sheet, Optional x As Long, Optional y As Long)
Dim atParamData() As Aucotec.AucExecuteSheetRecord
Dim sSheetPrefShapeType As String
Dim oMasterShape As Aucotec.MasterShape
Dim oPrefMaster As Aucotec.MasterShape
Dim oDefaultMaster As Aucotec.MasterShape
Dim oShape As Object 'Visio.Shape
Dim sStencilID As String
Dim sSymbolSync As String
Dim result As Variant
'set Mastershape
sSheetPrefShapeType = oSheet.Attributes.ItemByID(aucAttrPreferredShapeType).Value
For Each oMasterShape In oDevice.PreferredMasters
If Not oMasterShape.Attributes.Find(aucAttrShapeType) Is Nothing Then
If sSheetPrefShapeType = oMasterShape.Attributes.ItemByID(aucAttrShapeType).Value Then
Set oPrefMaster = oMasterShape
Exit For
End If
Else
Set oDefaultMaster = oMasterShape
End If
Next oMasterShape
If oPrefMaster Is Nothing Then
Set oPrefMaster = oDefaultMaster
End If
sStencilID = oPrefMaster.Parent.ID
sSymbolSync = oPrefMaster.Attributes.ItemByID(aucAttrSymbolSyncDesignation).Value
If sStencilID <> vbNullString And sSymbolSync <> vbNullString Then
Call oSheet.Open(aucSheetOpenVisio & aucSheetOpenAutosave)
'Check Area
ReDim atParamData(1 To 5) As Aucotec.AucExecuteSheetRecord
atParamData(1).qual = aucOpExecSheetCheckDropArea
atParamData(2).qual = aucArgExecSheetRef2Master
atParamData(2).Val = sStencilID & "#" & sSymbolSync
atParamData(3).qual = aucArgExecSheetPosX
atParamData(3).Val = x
atParamData(4).qual = aucArgExecSheetPosY
atParamData(4).Val = y
atParamData(5).qual = aucArgExecSheetRetVal
Call Utils.ExecuteSheetOperation(oSheet, atParamData)
result = atParamData(5).Val
If result = 1 Then
Call MsgBox("Collision")
End If
'Drop Symbol
ReDim atParamData(1 To 6)
atParamData(1).qual = aucOpExecSheetDropSymbol
atParamData(2).qual = aucArgExecSheetRef2Obj
atParamData(2).Val = oDevice.ID
atParamData(3).qual = aucArgExecSheetRef2Master
atParamData(3).Val = sStencilID & "#" & sSymbolSync
atParamData(4).qual = aucArgExecSheetPosX
atParamData(4).Val = x
atParamData(5).qual = aucArgExecSheetPosY
atParamData(5).Val = y
atParamData(6).qual = aucArgExecSheetRetVal
Application.AlertResponse = aucResponseYesOK
Call Utils.ExecuteSheetOperation(oSheet, atParamData)
result = atParamData(6).Val
Application.AlertResponse = aucResponseNone
'Call oSheet.Close
End If
End Sub
Thanks in advance