I recently using c# for grasshopper, and troubling with get ActiveViewport. The code that copy online do not work.
Hi @Dongao_Wang,
Try this:
private void RunScript(object x, object y, ref object A)
{
var view = RhinoDocument.Views.ActiveView;
if (null != view)
A = view.ActiveViewport.Name;
}
– Dale
1 Like