Dim node = CType(gvTask.Document.PickObject(e.ViewPoint, True), GoIconicNode)
It is on the ExternalObjectsDropped, I then execute code based on the dropped node’s properties. The problem I am having is that the point returned by both DocPoint and ViewPoint obviously do not relate to the node dropped as the node is nothing.
Is there a way around this? Could I use rectangle and force the users to drop near the top of the screen (not ideal)
Surely if the object dropped is a node how would it not relate to the node?
In addition this sometimes works and sometimes does not.
Look at ExternalObjectsDropped in the Processor sample. The GoView.Selection is the collection of objects just dropped. You don’t have to PickObject to find that object.
Hi Jake, I looked at that example, it does not have a list of selected objects.
If I could get access to the last dropped object not from a point that would be ideal.
Dim sel As GoObject = Me.goPalette1.Selection.Primary
Dim rn As RemoteConnectorNode = Nothing
If (TypeOf sel Is RemoteConnectorNode) Then _
rn = CType(sel, RemoteConnectorNode)
If (Not rn Is Nothing) Then
’ the newly copied node has already been added to the document–remove it
rn.Remove()
’ now look at the object at the event’s point, which should be a FlowLink
Dim link As FlowLink = Nothing
If (TypeOf goView1.Document.PickObject(e.DocPoint, True).ParentNode Is FlowLink) Then _
link = CType(goView1.Document.PickObject(e.DocPoint, True).ParentNode, FlowLink)
If (Not link Is Nothing AndAlso link.CanInsertRemoteConnectors()) Then
link.InsertRemoteConnectorsIntoLink(goView1)
End If
End If
End Sub
I tried that and it removes the icon from the palette
Dim obj As Object = Me.GoPalette1.Selection.Primary
'If (TypeOf gvTask.Document.PickObject(e.DocPoint, True) Is GoIconicNode) Then
If (TypeOf obj Is GoIconicNode) Then
Dim bSaveStep As Boolean = True
Dim [step] As New [Step]
'Dim node = CType(gvTask.Document.PickObject(e.ViewPoint, True), GoIconicNode)
Dim node = CType(obj, GoIconicNode)
If Not node Is Nothing Then
this gets more bizarre by the second, on the client machine it works fine for the first item in the palette but no the rest. This is exactly the same code as the development machine which works 95% of the item for all items in the palette