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
  • Hello Rick,

    I think you need to consider your requirement more detail, what's your final goal exactly, and what's the definition of "same geometries". Some examples:

    1. If there are two cells which has one circle, they looks same, but the cell origin are different, one is the center point, another one is a quarter point, are they same?

    2. Two circles again, only the line width is different, line width 0 Vs radius, are they same?

    There are reasons why no general tool to detect "same geometries", the definition is not same.

    Back to your question, I think it can be eliminated by good CAD spec, all users should not revise the cell, and all cells must have a unique name as per good naming rules. If cells have same name, then they must be same.

  • thanks for the reply, and yes it not clear for the definition of Same. to make things simple, in my case, I just copy a Cell and paste the Cell twice.

    at first I have only one Cell, then after paste twice, I have 3 Cells,  I just want to know the later two cells have the same geometry as the first one,

    the same geometry means consist of same geometry element, same size.. but the cell's position is different. or is there anyway from API side, I can check whether the later 2 Cells is copied from the first Cell.

  • I just copy a Cell and paste the Cell twice.

    If so, how could they be different?

    the same geometry means consist of same geometry element, same size

    An idea: scan all the sub elements in both cells, check each sub elements, if they are all same(you can define what means "same"), then the two cells are same.

    check whether the later 2 Cells is copied from the first Cell

    I don't think there is such function to record the source of the cell, they are independant elements. The most closest workaround, judge by the createdtime of the element? The copied cell must be later then the source cell. Is it OK for you?

Reply Children