Hello
How I can implement in RhinoCommon dragging something from my dialog and dropping it onto some scene object?
and of cause process dropping somehow - i.e. assign some custom data to attributes
Hello
How I can implement in RhinoCommon dragging something from my dialog and dropping it onto some scene object?
and of cause process dropping somehow - i.e. assign some custom data to attributes
Sorry, no. But the older Rhino.NET SDK does via the RMA.Rhino.MRhinoDropTarget class.
Here is an example of its usage:
To use Rhino.NET in a RhinoCommon plug-in, just add a reference to Rhino_DotNet.dll, which is found in Rhino’s SYSTEM folder. Make sure to set the reference’s Copy Local property to False.
More on Rhino.NET:
http://wiki.mcneel.com/developer/dotnetplugins
Note, adding drag & drop support to RhinoCommon is on the V6 list.
great, will try it, thanks!
It works:)
but how can I convert IRhinoObjRef here
OnDropOnObject(IRhinoObjRef objRef, MRhinoView rhinoView, DataObject data, DragDropEffects dropEffect, Point point)
to RhinoObject?
Instead of “converting”, you might just lookup the object by it’s runtime serial number.
For example:
void OnDropOnObject(
IRhinoObjRef objRef,
MRhinoView rhinoView,
DataObject data,
DragDropEffects dropEffect,
Point point
)
{
IRhinoObject rh_obj = objRef.Object();
if (null != rh_obj)
{
Rhino.RhinoDoc doc = Rhino.RhinoDoc.ActiveDoc;
if (null != doc)
{
Rhino.DocObjects.RhinoObject obj = doc.Objects.Find(rh_obj.m_runtime_object_serial_number);
if (null != obj)
{
// TODO...
}
}
}
}
thnaks! will try it