EBDN - Community - Question & Answers

  Tuesday, 08 October 2024
  2 Replies
  2.9K Visits
0
Votes
Undo
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 0. 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
Dawid Czepczur marked this post as Resolved — 5 months ago
5 months ago
·
#2847
0
Votes
Undo
Hi Alexander,

Additional information:
aucArgExecSheetRetVal correctly returns 1 only if a socket of an existing symbol is strictly inside the bounding area of the master you want to drop onto the sheet.

Important:
If a socket lies on the border of the bounding box, the result will still be 0.
A return value of 1 is set only when the socket is fully inside the area, not touching the border.
5 months ago
·
#2846
0
Votes
Undo
Hallo Alexander.

That looks like aucArgExecSheetRetVal hasn't value.

Example:
 aParams(1).qual = aucOpExecSheetConfigureView
aParams(2).qual = aucArgExecConfigureVisibilityMode
aParams(2).Val = aucConfigureVisibilityModeCtrlCriterionWithColor
aParams(3).qual = aucArgExecSheetViewTransparency
aParams(3).Val = lTransparencyValue
aParams(4).qual = aucArgExecSheetPrintTransparency
aParams(4).Val = lTransparencyValue
aParams(5).qual = aucArgExecSheetSelectedObj
aParams(5).Val = strIdxs
aParams(6).qual = aucArgExecSheetLineColor
aParams(6).Val = strColors
aParams(7).qual = aucArgExecSheetRetVal
aParams(7).Val = aReturnRecord

Best Regards,
Monika
Adrian Schilling assigned this post to Dawid Czepczur — 1 year ago
Alexander Stock set the post as Normal priority — 1 year ago
Alexander Stock set the type of the post as  Question — 1 year ago
  • Page :
  • 1
There are no replies made for this post yet.