[CONNECT C++] Making a Cell an Annotation Cell

In pre-CONNECT, there was an undocumented function one could use to take a non-annotation cell and make it an annotation cell:

extern "C" DLLEXPORT	StatusInt				mdlCell_setIsAnnotation(MSElementDescrP cellEdP, int isAnnotation);

 

however, this seems to remain un-documented in CONNECT. It also looks like IAnnotationHandler does not support cells. So, in the CONNECT environment, how would one make a non-annotation cell into an annotation cell? The use of mdlCell_setIsAnnotation() still works...

Thanks,

Bruce

  • The mdlCell_setIsAnnotation(cell->flags.isAnnotation) name actually is misleading it doesn't set "Is annotation" but sets "Annotation Purpose"(Can be placed as an annotation cell) property for cell.

    And you need to use mdlCell_setAnnotationScale otherwise the cell s not annotation until file is reopened.

  • Is there an answer to this question?  Neither function mdlCell_setIsAnnotation() nor mdlCell_setAnnotationScale() appears to be available in CONNECT.

    IAnnotationHandler does not support Normal Cells

    It also looks like IAnnotationHandler does not support cells

    That handler would be the logical way to go, but does not apply to normal cells.  Why not?

    ICellQuery.IsAnnotation

    ICellQuery.IsAnnotation tells me whether a cell can be used for annotation (NormalCellHeaderHandler inherits from ICellQuery). But where is the method to apply annotation scale?

    To put my question into context, I'm reading a cell from a library …

    if (SUCCESS == mdlCell_getElmDscr (&cell, ...)) 
    {
      const bool& TakeOwnership { true }; 
      const bool& IsUnmodified  { true }; 
      EditElementHandle header (cell, TakeOwnership, IsUnmodified); 
      ... 
    }
    

    What do I need to do to EditElementHandle header to turn annotation on?

     
    Regards, Jon Summers
    LA Solutions

  • welcome to the club. I have tried multiple times(starting from year 2013) using VBA to achieve correct conversion from normal to annotation cells with no success. Bentley support is of no help either as they are confusing "is Anntotation" property with "Annotation purpose" property and has limited understanding how annotation cells actually works. No wonder that annotation cells are not used much as it causes more issues as resolve and are not "transparent" regarding scales in which each cell is placed. Also even in CONNECT edition highlighting annotation cell it doesn't show cell name as it does for normal cells.

    Only option seems to deal with XAttributes and reverse engineer how it encodes annotation property and scale in which scale the cell is place. It seems only difference between normal and annotation cell is in XAttributes.