hi there,
I’m trying to create linear dimensions in grasshopper with specific properties.
Based on the C# code from here: How to use LinearDimension in C# - Grasshopper (grasshopper3d.com)
I can create a linear dimension in gh and bake it, however any changes to the properties, e.g. arrow size, are not baked.
What am I doing wrong?
I appreciate any help, as my googling skills have failed me so far…
private void RunScript(Point3d pt1, Point3d pt2, Point3d pt3, bool bake, Plane ppl, int fittext, ref object A, ref object B)
{
Plane plane = new Plane(pt1, pt2 - pt1, pt3 - pt1);
double u,v;
plane.ClosestParameter(pt1, out u, out v);
Point2d A2d = new Point2d(u, v);
plane.ClosestParameter(pt2, out u, out v);
Point2d B2d = new Point2d(u, v);
plane.ClosestParameter(pt3, out u, out v);
Point2d C2d = new Point2d(u, v);
LinearDimension ld = new LinearDimension(plane, A2d, B2d, A2d);
ld.ArrowSize = 0.5;
ld.ArrowheadType1 = Rhino.DocObjects.DimensionStyle.ArrowType.Tick;
B = ld;
if (bake)
{
var doc = Rhino.RhinoDoc.ActiveDoc;
if (doc.Objects.AddLinearDimension(ld) != Guid.Empty)
{
doc.Views.Redraw();
}
}
}