Changing the Graphic Group of cell elements

Hi Freinds,

I am modifying the Linear elements along with Point Elements (Cell and Text). After matching with target elements by rotation and scaling the elements. It is lossing the Graphic Group and another GGroup will be assigning. So i have tried to implement by setting the GGroup by get/Set. My code  is given below:

mdlElmdscr_readToMaster(&msedSrcElmP, elmDetailsP->ulElmFilPos, elmDetailsP->dgnModelRef, FALSE, NULL); --- Reading

mdlElmdscr_getProperties  (NULL, &uintggNum, NULL, NULL, NULL, NULL, NULL, NULL, msedSrcElmP); -- GGroup

mdlElmdscr_duplicate (&msedNewElmP, msedSrcElmP);

  mdlVec_subtractPoint (&dpSubPt, &dpNewOrgPt, &dpOrgPt);
    
  mdlTMatrix_getIdentity (&tMatrixNew);
   
  mdlTMatrix_setTranslation (&tMatrixNew, &dpSubPt);

  mdlElmdscr_transform(msedNewElmP, &tMatrixNew); ---- after Transforming
    
  mdlElmdscr_rewrite (msedNewElmP, msedSrcElmP, ulCurFilPos); ---   

mdlElmdscr_setProperties  (msedNewElmP,NULL, &uintggNum, NULL, NULL, NULL, NULL, NULL, NULL); - updating the Original GGroup

  mdlElmdscr_rewrite (msedNewElmP, msedNewElmP, ulCurFilPos); - rewriting

Please suggest me to resolve this issue.

Thanks,

Sreekanta.M

  • You haven't told us what is going wrong. What doesn't work?  Your topic headline suggests that the element is part of a cell: True or False?

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Hi John,

    Thanks for reply. I am trying to update cell element rotation with

    Previously the cell header having the GGroup having --7 (seven). After transforming the element that GGroup will be changing to 2(two). Why it has been changing? I have tried to update by assigning previous cell element GGroup to Post modification element GGroup number. But it is not working. I will be appricable for any suggestions.

    Thanks,

    Sreekanta.M

     

  • Unknown said:
    I am trying to update cell element rotation ...

    If you want to just transform the element then there's no need to duplicate it.  Apply the transform, then rewrite the descriptor.

    Unknown said:
    After transforming the element that GGroup will be changing to 2(two). Why it has been changing?

    It's not clear what's happening.  Try my suggestion to avoid that problem.

     
    Regards, Jon Summers
    LA Solutions

  • There's no reason for you to do anything special with the graphic group number...

    Simplify your code as follows:

    mdlElmdscr_read (&edP, elmDetailsP->ulElmFilPos, ACTIVEMODEL, FALSE, NULL); // Better be ACTIVEMODEL or you shouldn't be calling mdlElmdscr_rewrite!!!

    mdlVec_subtractPoint (&dpSubPt, &dpNewOrgPt, &dpOrgPt);
    mdlTMatrix_getIdentity (&tMatrixNew);
    mdlTMatrix_setTranslation (&tMatrixNew, &dpSubPt);

    mdlElmdscr_transform (edP, &tMatrixNew);
    mdlElmdscr_rewrite (edP, NULL, elmDetailsP->ulElmFilPos); // Don't need to pass old descriptor, it's completely ignored...

    If the above somehow changes the element's graphic group number you're clearly leaving something else out that you are doing...like an element descriptor to file asynch, etc.

    -B

    * Calling mdlElmdscr_duplicate just wastes some memory but is harmless...the duplicate in memory will have exactly the same gg number as the original.