Cancel
Showing results for 
Search instead for 
Did you mean: 

Draft - Drag document and drop inside of sheet

Genius
Genius

Hello developers, I have a question about drag a part/sheet metal/assembly document and drop inside a sheet Draft document.

 

I have a string fullFileName. How do that? With events? Does anyone have any sample code?

 

QuickSheet.PNG

 



==========================
Kabir Costa
Industrial Designer
kabircosta@gmail.com
1 REPLY

Re: Draft - Drag document and drop inside of sheet

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hi,

I made a little example. Just copy-paste the code in a VB.Net project.

It is a form with a textbox with a .par filename in it,

You can drag from the textbox and drop into a sheet in an open DFT file in Solid Edge. (it places a view)

The same thing can be done with an open ASM. the part will be placed.

form.PNG

The code is this:

Public Class Form1

    Dim isMouseDown As Boolean = False

    Private Sub TextBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDown
        isMouseDown = True
    End Sub

    Private Sub TextBox1_MouseMove(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseMove
        If isMouseDown Then
            Dim files(0) As String
            files(0) = TextBox1.Text
            Dim data As DataObject = New DataObject(DataFormats.FileDrop, files)
            DoDragDrop(data, DragDropEffects.Copy)
        End If
    End Sub

    Private Sub TextBox1_MouseUp(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseUp
        isMouseDown = False
    End Sub

End Class
Julian Guillo
Pixel Sistemas SL
Spain