algorithmic modeling for Rhino
I have a question regarding the Rhino.Display.DisplayConduit class which i use as a base class for my own custom class. Is it possible to implement mousecall like
this.MouseDown +=new EventHandler<Rhino.Input.Custom.GetPointMouseEventArgs>(lol_MouseDown);
to get some interaction like nomal Rhinoobjects? (select,delete,etc...) Maybe where is some interface for this?
or is this only possible with the RMA... I was googleing and i only found something very uncertain that this could be possible..
http://python.rhino3d.com/threads/196-register-event-observer-pattern
thx in advance
Michael
Tags:
Hi Michael,
the DisplayConduit is meant to draw objects that are not in the document. Object picking uses the document to search for objects to be picked. This results for now in the fact that you cannot pick objects from conduits.
Additionally, currently DisplayConduit is implemented on top of the DisplayPipeline static events. All methods that are available are listed here. These are drawing-related methods.
I hope this helps,
- Giulio
________________
giulio@mcneel.com
Hi Giulio,
so where is no possibility to crate a class with can be picked by a mouse?
Hi Michael,
DisplayPipeline geometry is not selected automatically. You could construct your logic that would find the object departing from its location and the mouse position. But generally you pick objects that are in the document. For this reason, you can also add grips and other similar tools to help picking to the document itself. After all, also Grasshopper uses a special conduit and you cannot pick its rendered objects.
Thanks,
- Giulio
________________
giulio@mcneel.com
I think Grasshopper is only catching the guid of the object refenced, not the object itself. So it tests if something was changed in the document and then compare it with a the registered objects guids.
Is it possible to implement a custom grip in a class, maybe where is a example existing...but i think grips are only for moving controlpoints... maybe i am wrong.
public class test_mouse_events : Rhino.UI.MouseCallback
{
public bool run = true;
public test_mouse_events() : base()
{
this.Enabled = true;
}
protected override void OnMouseDown(Rhino.UI.MouseCallbackEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
System.Windows.Forms.MessageBox.Show(e.ViewportPoint.ToString());
}
if (e.Button == MouseButtons.Right)
{
this.Enabled = false;
}
base.OnMouseDown(e);
}
}
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by