I’m working in Rhino Plug-In written in C++. And yes, I have to use a second thread.
In the past days, I made some progress.
I have created object from the CRhineAnnotationText class, and using its Explode function I’m able to get the text-shaped curves for the text.
I have noticed that Explode function is working only if the object is added to the document.
CRhinoAnnotationText *objectText = new CRhinoAnnotationText(); objectText->SetTextHeight(30); objectText->SetString(textToShow); objectText->SetFontIndex(RhinoApp().ActiveDoc()->m_font_table.FindOrCreateFont(wFont, style & 1, style & 2)); ON_SimpleArray<ON_Curve*> textCurves; objectText->Explode(textCurves); //textCurves remains empty after this function execution.
For the function Explode to work, I have to add the object to the active doc (call the function RhinoApp().ActiveDoc()->AddObject(objectText) before Explode)
Is it safe to add objects to the document from other but the primary thread? If not how to make the function Explode to work without adding object to the document. Or can you recommend some other way to achieve this.