Enabling Point vector manipulators

I can create a point object with C# right beside my current component.
However, when I add that point object to the canvas it does not come with the preview vectors that you get when selecting a point on the canvas.

How can I add those preview and manipulation vectors?

my code:

if (!run) return;
var pivot = this.Component.Attributes.Pivot;
System.Drawing.PointF pointPivot = new System.Drawing.PointF(pivot.X - 230, pivot.Y - 24);

var ghPoint = new Grasshopper.Kernel.Types.GH_Point();
ghPoint.CreateFromCoordinate(new Point3d(8, 7, 0));
Grasshopper.Kernel.Parameters.Param_Point point = new Grasshopper.Kernel.Parameters.Param_Point();
point.CreateAttributes();
point.Attributes.Pivot = pointPivot;
point.AddVolatileData(new Grasshopper.Kernel.Data.GH_Path(0), 0, ghPoint);

this.GrasshopperDocument.ScheduleSolution(1, doc =>
  {
  this.GrasshopperDocument.AddObject(point, true);
  });

how can I enable those colored vectors to let a user change the point?

Param_Point

private void RunScript(bool run, ref object A)
{
  if (!run) return;
  var param = new Param_Point();
  param.CreateAttributes();
  param.PersistentData.Clear();
  param.PersistentData.Append(new GH_Point(new Point3d(8, 7, 0)));
  param.Attributes.Selected = true;
  param.ExpireSolution(true);
  param.Attributes.Pivot = new PointF(0, 0);
  GrasshopperDocument.AddObject(param, false);
}

Param_Point.gh (2.0 KB)

1 Like

Hi @Mahdiyar
The solution works perfectly!
Thanks for the awesome suggestion :pray: :grin: