Getting file position of the cell sub elements.

Hi All,

I'm developing a MDL programm in Microstation V8 XM. I have a Cell (not shared cell) element in the desing file. The cell contains text and shape as sub elements. Just I want to read the file position of each sub elements and write it into a log also I want delete all the shape elements.

So how to read the file position of each sub elements inside the cell and how to delete it (for delete also i need file position)?

Please help me.

Thanks & Regards,

Jeyan

Parents
  • Loop over all elements in chain, if element is shape and you want remove it, use mdlElmdscr_removeElement.

    To get elements file position, you can use elementRef_getFilePos or mdlElmdscr_getFilePos , but I do not think that it is good idea to delete component element this way...

    EXAMPLE:

    MSElementDescr* myCell = GetSomehowCell();
    MSElementDescr* edP = myCell->h.firstElem;
    while (edP)
    {
      if (edP->el.ehdr.type == SHAPE_ELM)
      {
        AddReport(mdlElmdscr_getFilePos(edP)); 
        edP = mdlElmdscr_removeElement(edP);
      }
      else edP = edP->h.next 
    }

    mdlElmdscr_rewrite (myCell, 
    NULL, mdlElmdscr_getFilePos(myCell));

    Dan

  • Hi Dan,

    Thank you for your helpful solution.

    Regards,

    Jeyan

Reply Children
No Data