Hi
In Rhino view properties tab, the name of the active view and other settings changed automatically when the viewport changed
What is the event used and how to use it in c#?
Hi @anon39580149,
There are a number of RhinoView events you can subscribe to:
https://developer.rhino3d.com/api/RhinoCommon/html/Events_T_Rhino_Display_RhinoView.htm
RhinoView.Modified
is probably what you want.
– Dale
Hi @dale
Thank you, i don’t find an example how to use RhinoView.Modified
,
and in Visual studio activeview don’t have Modified
UPDATE:
Maybe like this?
Hi @anon39580149,
Maybe this?
public class TestSeghier : Command
{
public TestSeghier()
{
Instance = this;
RhinoView.SetActive += OnViewSetActive;
RhinoView.Modified += OnViewModified;
}
public static TestSeghier Instance { get; private set; }
public override string EnglishName => "TestSeghier";
private static void OnViewSetActive(object sender, ViewEventArgs args)
{
RhinoApp.WriteLine(">> RhinoView.SetActive");
}
private static void OnViewModified(object sender, ViewEventArgs args)
{
RhinoApp.WriteLine(">> RhinoView.Modified");
}
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
return Result.Success;
}
}
– Dale
Thank you very much @dale
I will test it
Use the ViewEventArgs parameter passed to the events to get information about which view you are being informed about
Thanks @stevebaer
The script of @dale works great
I use RhinoView event with Rhinoinside to get activeview in Grasshopper.
I will try more events