It looks like you're new here. If you want to get involved, click one of these buttons!
hi @Matthias ,
When some cells created from a library, and open again without that library, the cell names "cell1" changed to "<defunct>cell1"
I want to update the cell names to remove "<defunct>".(I do not want the referred library, I only want to change the cellname back)
However with the following codes, I find newName already removed "<defunct>", but a.name cannot be assigned the new name, its name is still the old name with "<defunct>".
What is wrong with my code?
Anothe question is if with the refered library, the cell structure will be:
TOP
->library1.cell1
Is there anyway to remove the library1, make the structure changed to:
TOP
->cell1
Thank you very much!
cv = RBA::CellView::active
ly = RBA::CellView::active.layout
cell_list = []
for a in ly.each_cell do
if /^<defunct>CellName/.match a.name then
newName=a.name
newName["<defunct>CellName"]="CellName"
print("newName:",newName,"\n")
a.name=newName
print("aName:", a.name,"\n")
end
#end if
cell_list << a.name
end
#end for
print(cell_list)
print "\n"
Comments
Hello,
The
<defunc>
message means that KLayout knows the cell should come from a library, but that library is not available. This information is not part of the cellname, but knowledge that KLayout has about your cell. It keeps this knowledge to be able to restore the link to library when it's available again.What you need is a way to disconnect a cell from a library. This is done by converting a cell to a "static" cell. "static" here is a synonym for "local". To convert the cell, use
Matthias
hi @Matthias ,
I tried to print the cell name, it was always with <defunc>, after I used convert_cell_to_static, the structure was still
TOP
-><defunc>libname.cell1
I also found cell_index was always same.
May I know what is wrong with it?
How can I remove the libname?
I would like use layout.read() to merge two GDS files, if cellname are same from the two GDS, the cell will merged.However the cellname in one GDS is <defunc>libname.cell1name and in another GDS is cell1name, they cannot be merged.
Thank you very much!
I'm sorry, the conversion of all cells is a bit more elaborate. "convert_cell_to_static" will just create a new copy, but not replace the cell. Replacing is done by doing the conversion over each instance:
This will also convert the cell names and remove the lib name. But still this does not solve the problem as the
<defunct>
cells apparently are not handled (reasoning maybe like "they are already broken, so why disconnect them ..."). You can call this a bug - I have created a ticket for this problem: https://github.com/qt/qtbase/branches/all?page=2).So far, the easiest alternative solution is to save the file without the context: this will leave the basic name. You can do so in a script this way:
Regards,
Matthias
hi @Matthias ,
Thank you so much!
Your easiest solution is the best!!!