About CRhinoAnnotationText in V6

My code in V5 as following, but I don’t know how to convert that to V6, because there is no CRhinoAnnotationText on V6.

In the CRhinoAnnotationText* text_object
I want to SetAnnotation, SetTextHeight, SetString, SetPlane, SetJustification and SetFontIndex.

//my code in v5

CRhinoAnnotationText* CCommandSample::AddAnnotationText(const ON_3dPoint& pt, const wchar_t* text, double height, const wchar_t* font, int style, double rotate, ON_Annotation2::eTextJustification Justification)
    CRhinoAnnotationText* text_object = new CRhinoAnnotationText;

    ON_wString wText(text);
    if (wText.IsEmpty())
      return text_object;

    if (height <= 0)
      height = 1.0;

    ON_wString wFont(font);
    if (wFont.IsEmpty())
      wFont = L"Arial";

    if (style < 0 || style > 3)
      style = 0;

    ON_Plane plane = ON_xy_plane;
    plane.Rotate(rotate, ON_zaxis);

    ON_TextEntity2* text_entity = new ON_TextEntity2;
    int idx = ::RhinoApp().ActiveDoc()->m_font_table.FindOrCreateFont(wFont, style & 1, style & 2);

    return text_object;

Hi @angelwang,

One of the biggest changes to Rhino 6 is in the area of annotations. Here is an overview of what’s new:


And here is an example of using the new SDK classes:


Let me know if you have questions.

– Dale

Thanks for your answer.

Now I have another question.
How to explode the object of CRhinoText to curves?
Before there is explode function in CRhinoAnnotationText, but I can’t find this kind function in V6.

Hi @angelwang,

Use RhinoGetTextOutlines. See rhinoSdkUtilities.h for details.

– Dale

Hi @dale

How to get user string from CRhinoText?

How about this?

CRhinoObjRef object_ref = ....;

const CRhinoText* obj = CRhinoText::Cast(object_ref.Object());
if (nullptr != obj)
  CRhinoDoc* doc = obj->Document();
  if (nullptr != doc)
    const ON_DimStyle& dimstyle = obj->GetEffectiveDimensionStyle(doc);
    const ON_Text* text_obj = obj->TextObject(&dimstyle);
    if (nullptr != text_obj)
      ON_wString value = text_obj->PlainText();
      // TODO...

– Dale

Hi @dale

Thank you very much. it works fine.