How to check whether the Cell is copied from another cell, or how to check two Cells has the same geometries?

Hi Experts,

  I have a simple model with Just one Cell, then I copy the Cell and place the copied Cell to the model twice,  the model looks as below, and i have attached the .dgn model

I am running a Microstation CE.

copied items.dgn

now with the api, i can get 3 cells,  the quesiton is that how can i check whether those cells have the same geometry, only difference is the postion/transformation.  is it possible to tell the source Cell of a copied cell.

I just want to know those cells have the same geometry(except the position/transformation).

thanks,

Rick

Parents
  • Hi 

    Although other element comparison APIs may exist, I (quickly) found two MDL native C API functions that may help.

    Hint: If you transform both elements to the identity (in memory) you may be able to use the first function, otherwise the 2nd function provides the most flexibility of this otherwise complex topic.

    1. mdlElmdscr_areTwoIdentical. This takes two elmDscr and performs a high level and rigorous comparison.
    2. mdlElmdscr_areIdenticalToTolerance. This function takes two elmDscr for comparison and providing a number of flexible COMPAREOPT_ ComparisonFlags contexts (see: Mstn\MdlApi\mselmdsc.fdf:2852) and tolerance values you can tune to ensure matches have the level of equality needed.

    HTH,
    Bob



Reply
  • Hi 

    Although other element comparison APIs may exist, I (quickly) found two MDL native C API functions that may help.

    Hint: If you transform both elements to the identity (in memory) you may be able to use the first function, otherwise the 2nd function provides the most flexibility of this otherwise complex topic.

    1. mdlElmdscr_areTwoIdentical. This takes two elmDscr and performs a high level and rigorous comparison.
    2. mdlElmdscr_areIdenticalToTolerance. This function takes two elmDscr for comparison and providing a number of flexible COMPAREOPT_ ComparisonFlags contexts (see: Mstn\MdlApi\mselmdsc.fdf:2852) and tolerance values you can tune to ensure matches have the level of equality needed.

    HTH,
    Bob



Children