Preview Annotations C++

Hi,

I have another question about the Conduit. I am not finding a function to draw/preview Annotations (ON_LinearDimension, ON_RadialDimension, …) ?

Also I am not sure how to handle ON_Annotations in general. Is there an example on how to create them, or how to add them to the document? Without the CRhinoAnnotationObject? (for example, I can simply draw an ON_Mesh with context.m_doc.AddMeshObject() or preview it in a conduit with dp.DrawShadedMesh())

Thanks!
Milos

Hi Milos,

Yes, annotations do work different than other geometric objects. To draw them in a conduit or in a dynamic draw operation, just call CRhinoAnnotationObject::Draw().

– Dale

@dale
Is there any Method like “Draw()” in C#?

Hi @1056960357,

Can you provide any details on what you are doing, or that you want to do?

Thanks,

– Dale

Hi @dale

I want to write an grasshopper component to preview annotations like LinearDimension and AngularDimension.
And I can not find the method like Draw() in C# to draw the annotations
in DrawViewportWires Or DrawViewportMeshes

ps: Displaypipeline Class seem to have an method DrawAnnotation() but it could not work well

@Alain - is this something you can help with?

Hi,

You can extend the DisplayConduit class and override PostDrawObjects.

In that method you can call drawEventArgs.Display.DrawAnnotation(linearDim, Color.Blue)

Does that help?

Hi @Alain @dale @DavidRutten, I still have a puzzle about Why when I use the DrawAnnotation(annotation, color) in Grasshopper inner DrawViewportMeshes(IGH_PreviewArgs args) method the color only affect the dimension’s arrow and the text, and the other is still black, and I think this is an bug of the DrawAnnotation the detail is as follow:

@Alain @DavidRutten is this an bug of DrawAnnotation method?

@Alain, is this something you know anything about?

@dale@Alain,@DavidRutten Is Anyone have any idea about this proplerm?

Hi,
Could you share your code instead of a screenshot?
Thanks

Hi @Alain Thank your for your attention.
The Code and the Grasshopper demo file is attach as below. Thank again

:Code.cs (2.6 KB)
Demo.gh (7.7 KB)

Sorry, I can’t reproduce that problem and don’t have any ideas on what may be causing it.selected unselected

Hi @Alain What the runtime version of your RhinoCommon When you test the *.gh file that I upload?
And My Version is v4.0.30319