Create multiple Annotation Features using ProToolkit
I am trying to use ProToolkit to create annotation features (Toolkit for 3D Drawings license). I am calling a function 'InsertAnnotationFeature' repeatedly, once for each annotation feature I need to insert. In my test case, I have to add several annotation features (8). The first time the function is called, it works fine. However, the next call to the function locks up (crashes) Pro/E on the ProAnnotationfeatCreate API.I tried adding a couple of different things at the bottom of the function to see if that made a difference (a repaint and a ProSelectionFree), but the crash still occurred. Has anyone had problems with the function to create an annotation feature?
This particular test case uses Wildfire 5, as the testfile was generated in WF5. In general, this development effort is done simultaneously in WF4 and WF5. (We will be expanding this to Creo1 and 2 in the next month).
The Insert function is shown below. Any suggestions as to why this function might be causing Pro/E to crash/lockup would be helpful?
Regards,
Sharon Barber
ProError CMBDCadInterface::InsertAnnotationFeature(shared_ptr<cmapannotfeat> pAnnotFeat)
{
ProMdl proModel;
ProModelitem proModelItem;
// get current model and create a model item from model. Then select that model.
if (err == PRO_TK_NO_ERROR) err = ProMdlToModelitem(proModel, &proModelItem);
// allocate the new annotation feature (selection is model, and boolean says to NOT bring up the User Interface, but to automaticallty generate a single general annotation element
// change the name of this new feature
/** Additional code to add the desired annotation elements (e.g. notes, symbols) will be inserted here. */
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

