How could I write to OAS.gz file

edited May 2013 in Ruby Scripting
Dear Matthias:
I am coding the macro. When I excute a huge Boolean operation on layout. I met the job was kicked by administrator. So I need write a script to save the file. I check your batch cell file save. I modified like:

i=10
ly = RBA::Application::instance.main_window.current_view.active_cellview.layout
fn = "trial_" +i.to_s+".OAS.gz"
opt = RBA::SaveLayoutOptions::new
gzip = opt.set_format_from_filename(fn)
ly.write(fn, gzip, opt)

The error message showed the file option not defined. How could I define the OAS option?
Thanks!
Sincerely,
arided

Comments

  • edited November -1
    Hi,
    I finished to debug:

    i=10
    ly = RBA::Application::instance.main_window.current_view.active_cellview.layout

    fn = "trial"+i.to_s+".OAS.gz"
    opt = RBA::SaveLayoutOptions::new
    opt.format="OASIS"
    opt.oasis_compression_level=7
    ly.write(fn, true, opt)

    The 0.21.19 has a little bug is the layer datatype cannot be float. Otherwise, it cannot be saved in this code.
    arided
  • edited November -1

    Hi Arided,

    your solution is correct.

    The set_format_from_filename method expects a lowercase ".oas.gz" to correctly set the format. But your solution works in every case.

    Float layer and datatype number do not make much sense. You can convert a float however with "to_i" into an integer.

    Regards,

    Matthias

Sign In or Register to comment.