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.
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).
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.
Rick cheng said:I just copy a Cell and paste the Cell twice.
If so, how could they be different?
Rick cheng said: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.
Rick cheng said: 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?
the copied cells can be paste at different locations, it's very common when do modeling, for example, we have 4 Desk in a room, what i will do first is to create a Cell to represent the Desk, then copy and paste the Desk 3 times, then we have 4 Desk Cells, all those 4 Cell have the same Geometry representation, but only at different locations.
MicroStation provides two related items/concepts that may also help with improving your confidence and standards further.