Support Forum

Files Are Not Saving Correctly

Morgan

Monday 3rd July 2023
Hello, I have an issue where after running the 'saveFile' operation, my scripts are not completing, and hang after the file is supposed to be saved. Sometimes the files are saved correctly, but sometimes they do not save. Is there a log file where I can view errors during the script execution to try and observe what's causing the issue?
Jürgen
LayoutEditorFull
Monday 3rd July 2023
Can you explain it a bit more detailed? I am right that you are using Python scripting? When you start the LayoutEditor (the .exe on windows) with the command line option "--debug" it will output on Python as well debug information. Did you check the file/folder permissions on the target folder? What happened in the case the save does not work? Is no output file created? I assume you have a license key installed. If not, there will be a file size limit for the output.
Morgan

Wednesday 5th July 2023
I am using Python scripting. With the --debug flag, I'm able to see the issue with the Python script. When the line 'cl = l.drawing.addcell()' is executed, the script errors out, and returns a long error log. I've attached the error log here as a text file. Seems like there is an issue with attempting to call the API within an installation that has restricted permissions. I am currently using the free version, but writing a script with the intent to use the full license. If the file size is too large, would I be able to see this from within the Python script? For reference, my code is: ``` import LayoutScript from LayoutScript import * import os ... ... **l = project.newLayout() ** for chip in range( chip_num ): cell = l.drawing.currentCell cl = l.drawing.addcell() cellname = "ridge_" + str(chip) cl.thisCell.cellName=cellname l.drawing.setCell(cl.thisCell) pitch = 500 offsetx = chip * pitch offsetz = -15000 parray = pointArray() for point_ in waveguide_points[str(chip)]: for xm_, xp_, z_, in zip(point_['xm'], point_['xp'], point_['z']): pl = point(xm_ + offsetx, z_ + offsetz) mi = point(xp_ + offsetx, z_ + offsetz) parray.append(pl) parray.append(mi) bspl = parray.BSpline() l.drawing.saveFile(r"C:\Users\Morgan.TurvilleHeit\Documents\LayoutEditor\bars\test_out_new.gds") print("Python save complete") ``` Additionally, I believe there is an issue with how I've written the above script, as I am not seeing any objects created during the execution. Is this the correct usage of BSpline()? Thank you, Morgan
Jürgen
LayoutEditorFull
Wednesday 5th July 2023
Hi Morgan, the lone ```cl = l.drawing.addcell()```should raise an error *object has no attribute addcell*. The correct line should be ```cl = l.drawing.addCell()```with capital C. The line ```bspl = parray.BSpline()```will create a pointArray containing the BSpline, but does not add it to any cell. So you additional need to create a polygon with this pointArray and set a layer for it: ``` mycell.addPolygon(parray.BSpline(),layer_num)```
Morgan

Thursday 6th July 2023
Great, thank you!