How to set the origin in building a new cell

Hi, There,

I am writing an MDL app  to make the new cell from an existing one. I need to ensure that the origin of the new cell is the same as the original cell.  I did the following:

1. Place a cell.

2. Read the newly placed cell back. and get the origin of the cell, say oldOrigin

3. Create a new cell header as follows:

mdlCell_create( &newCellElm, cellNameW, &oldOrigin, FALSE);

mdlElmdscr_new (&newCellDP, NULL, &newCellElm);

4. Add the original cell to the new cell.

mdlElmdscr_appendDscr(newCellDP, oldCellDP)

5. Add the new cell to the cell lib.

mdlCell_addLibDescr (newCellDP, -1, FALSE)

The cell was created successfully. However, the origin was not the same.

If I place the old cell at the location (0,0,0) and create the new cell mdlCell_create( &newCellElm, cellNameW, NULL, FALSE);

Then the new cell will have the same origin as the old one.

Can anyone tell me how to resolve the problem without needing to place the old cell at the location (0,0,0)?

Any suggestion will be greatly appreciated.

Ken