Change Arrow length/size

We know how to change arrowhead length in dimension style…as below

        Rhino.DocObjects.DimensionStyle dimension_style= doc.DimStyles.CurrentDimensionStyle;
        dimension_style.TextHeight = 0.5;
        dimension_style.ArrowLength = 0.5;
        dimension_style.CommitChanges();

But if the arrowhead is a decoration object, it does not change from default, if we change the arrowlength from dimension style. Please some one, edit the code below and let me know how I can change the arrow length when it is a ObjectDecoration not a dimension style

public static Rhino.Commands.Result ObjectDecoration(Rhino.RhinoDoc doc)
{
// Define a line
var line = new Rhino.Geometry.Line(new Rhino.Geometry.Point3d(0, 0, 0), new Rhino.Geometry.Point3d(10, 0, 0));

// Make a copy of Rhino’s default object attributes
var attribs = doc.CreateDefaultAttributes();

// Modify the object decoration style
attribs.ObjectDecoration = Rhino.DocObjects.ObjectDecoration.BothArrowhead;

// Create a new curve object with our attributes
doc.Objects.AddLine(line, attribs);
doc.Views.Redraw();

return Rhino.Commands.Result.Success;
}

Have you looked at the DisplayPipeline Class? http://4.rhino3d.com/5/rhinocommon/?topic=html/AllMembers_T_Rhino_Display_DisplayPipeline.htm

Specifically: http://4.rhino3d.com/5/rhinocommon/?topic=html/M_Rhino_Display_DisplayPipeline_DrawArrow_1.htm

This allows you to define the screen and relative size of the arrow. Ideally, there would be some way to access the document default for these as you mention with dim styles. I am not sure this is exposed in RhinoCommon.

1 Like

Thanks !.
I have implemented in display conduit before. Not sure why it is not available as normal drawing object. there must be a way to change the default setting for the arrow size… This is what I am looking for.
but can we add “doc.Object.AddArrow ?” I think no
I really want to know from Dale if I can change the size of the arrow the way we can change the size of arrow in dimension style.
In my case Arrow cannot be only display… they need to be Rhino Object and I should be able to select them. Just display does not serve the purpose.
For example We can select the line with arrow as decoration object… so there must be a way to change the default setting for the arrow size…

The size of those decoration arrowheads is not in model units. It is in screen units, meaning it will stay the same size on the screen when you zoom in, not like geometry objects that are sized in model units and change size on the screen when you zoom in.

There is a setting which I think is called CRhinoAppAppearanceSettings::m_direction_arrow_icon_head_size in the c++ sdk that controls the size in pixels. Unfortunately it also controls other arrow head sizes like the arrows used for indicating object direction, etc.
I don’t think its exposed in RhinoCommon.

You didn’t say what you’re trying to do, but if you want to control the arrowhead size like geometry, in model units, it’s not going to work. That’s not what those arrowheads are for. They were designed to stay the same size on the screen like dots.

1 Like

Many thanks Lowell ! :slight_smile: OK I understood. In that case I have to find other alternative. I needed some arrows in 2d drawings to describe something.

In dimension style I had change the size of the arrow and it works. Now I need few arrows to indicate something in the drawing, so I tried those ObjectDecoration. I needed them for indicating few points and direction, as you assumed.
If you know for drawing few arrows in the drawing detail, other than using dimension style and ObjectDecoration, then please let me know. I guess there is nothing in RhinoCommon as you mentioned already.

Many thanks !

I have decided to draw small tiny triangles with solid hatches and then make them blocks.
It looks work for me, as they are only few in number.
Other arrows can be dimension style.

So you can say problem is solved for now.

Many thanks again for the above explanation!

Maybe you could use leaders with no text

1 Like

Yes , thanks. But i have some curves. I wrote a code with hetch and it is working perfect now.

Hi,
I also like to change the size of arrowheads on screen. Would you share the code?
Thanks,

Hi @S_Yoon,

What arrowhead? How would you do this in Rhino? Are you using RhinoCommon or C++? Do you have some code that doesn’t work?

– Dale