How to insert new component in assemly like as toolbox part (new component NOT as toolbox component, it's a simple part).
I mean get user posibility to preview component and pick point later.
You can call DoDragDrop (if this is a .NET application) with Link DragDrop effect and data as DataFormats.FileDrop. So basically you can drop the component from your application as it would be dropped from the Windows File Explorer.
Hi, Artem. DoDragDrop method i need to rize on what? PMP, SW Window Handler, Some UserControl...ModelView
Let me explain.
I have a PMP. I will select there some data from which I generate a file. By clicking on the button in the PMP, I want to insert this new component into the assembly. The component itself I have already automatically generated in the TEMP folder. Well - I want to repeat the actions D'n'D like in the toolbox.
Yes, I meant to use DoDragDrop on Windows Forms Control (which might be hosted in PMP). You also have a Win32 version of this method. But this approach would require to hold the left mouse button while dragging and releasing it when finished. But as far as i understand you want the other way around? I.e. when mouse button is released component is dragged and it is inserted when the button is clicked?
D'n'D from UserControl I realized. You right, it can be possible when mouse button is hold.
And true - I want only "Click" button on my PMP and then only set pick points on assembly to insert models (like a screenshot in first post). Do you think it's possible?
Let me look into this. I do not know of any direct API of doing this. But that should be possible with some win api tricks.
Unfortunately I didn't found the easy way. But what I can suggest as a try is:
This is might be quite cumbersome solutions. Have you considered dropping the components with left mouse pressed (simple drag-n-drop as we have discussed before)?
I'm interesting, how Solidworks programmers has done inserting the Toolbox components with many times "picking" ?
Without the drag drop visual this is a simple task. Well kind of.
First write your auto mate methods.
Then when assemblydoc userselectionnotify is fired, insert the component that you have selected in your form at the feature that the user has selected in the model view.
This is where you need to write the auto mate methods and use them.
Retrieving data ...