Merge function in File menu

edited May 2012 in KLayout Support
Hi Matthias,

We tried to merge two database and found a problem might be a bug.

To reproduce the issue, please prepare two simple database:

DB1: Topcell(with some patterns and layer=1/0)
DB2: Topcell(with some patterns and layer=1/0)

Open DB1 and then Click File => Import => Other File Into Current

Fill Input File with DB2, and Select Import Mode with Merge option(Merge hierarchy has the same result), click Import.

Two file merged, however the patterns in DB1 disappeared.

Please help to confirm if it's bug or our operation issue, really thanks for your kindly support and hard work.

Klayout version: 0.21.17

Best Regards,


  • edited May 2012

    Hi chhung,

    thanks for that hint. It's actually a bug. I'll fix it in the next release.

    Here is a quick patch at line 349 of

    -      target_cell.shapes (lm->second).assign_transformed (source_cell.shapes (lm->first), shape_trans, pm);
    +      target_cell.shapes (lm->second).insert_transformed (source_cell.shapes (lm->first), shape_trans, pm);

    The reason why this bug was not found earlier is that usually people either import into separate cells (none of the "merge" modes) or on different layers (with an offset). The use case where that bug happens is if you are basically mixing layouts. That appears to be a rare use case.

    As a workaround you could import into separate cells and create a new top cell above the new one imported and the original top cell.

    Thanks and best regards,


Sign In or Register to comment.