• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Modify film_reorder.il

Stats

  • Replies 9
  • Subscribers 163
  • Views 15992
  • Members are here 0
More Content

Modify film_reorder.il

bulldog
bulldog over 12 years ago

I have been looking at the program "film_reorder.il" (available at cadence.com) and have found it useful but would like to make a small modification to it.  After you have selected a layer to be moved (up or down) in the list you have to re-select it if you want to move it more than one position.  Does anyone know of a way to modify this program so the selected layer stays selected until another layer is selected?  I would like to just click the up/down arrow X times until it is moved into the correct position without having to keep re-selecting the layer.

Thanks!

  • Sign in to reply
  • Cancel
  • Ejlersen
    Ejlersen over 12 years ago

    Hi

    That is possible. You'll have to save all current visibility settings - the easiest thing would probably be to create a script that saves a temp colorview file to disk. When you close the program this color view should be reselected and then the temp file deleted.

     Similarly selecting a film could load the corresponding film.

    (defun _ns_save_org_colorview ()
    let((tmp_file)
     ;------------------- save the original color view for later restoration
     tmp_file = axlDMOpenFile("ALLEGRO_SCRIPT", "tmp", "w")
     fprintf(tmp_file "scriptmode +i +n +w +c\n")
     fprintf(tmp_file "setwindow pcb\n")
     fprintf(tmp_file "colorview create\n")
     fprintf(tmp_file "setwindow form.colorview_create\n")
     fprintf(tmp_file "FORM colorview_create colorview_name ns_pdf_out\n")
     fprintf(tmp_file "FORM colorview_create save\n")
     fprintf(tmp_file "FORM colorview_create done\n")
     fprintf(tmp_file "setwindow pcb\n")
     axlDMClose(tmp_file)
     axlShell("replay tmp")
     if( isFile( "tmp.scr") then deleteFile("tmp.scr"))
    )
    )

    (defun _ns_load_view (f2view)
    let((tmp_file)
     ; load the original color view
     tmp_file = axlDMOpenFile("ALLEGRO_SCRIPT", "tmp", "w")
     fprintf(tmp_file "scriptmode +i +n +w +c\n")
     fprintf(tmp_file "setwindow pcb\n")
     fprintf(tmp_file "setwindow form.vf_vis\n")
     fprintf(tmp_file "FORM vf_vis colorview_list %s\n" f2view)
     fprintf(tmp_file "setwindow pcb\n")
     axlDMClose(tmp_file)
     axlShell("replay tmp")
     if( isFile( "tmp.scr") then deleteFile("tmp.scr"))  
    )
    ) 

     

     

     

    Best regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • seyerfred
    seyerfred over 12 years ago

    Hi

    the code is for colorview create function, for what i mean loading the artwork film in the list and  when select from list window

    it will display the desired artwork. 

    Thank you... 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Johnny Lam
    Johnny Lam over 9 years ago

    Hi Ole,

         I like this film_reorder skill file, But when I insert code. did not work for me. Please help.            

    )
    ("UP"
    for(key 0 film_count-1
    film_order[key] = nth(key val)
    ); end for unless
    (setq count -1) (setq j -1)
    (prev_list = final_list = next_list = nil)
    (setq sel_index 0 )
    sel_items = axlFormListGetSelItems(myform "FILMS_LIST")
    unless(length(sel_items) != 1
    foreach(items val
    j++
    unless(items != car(sel_items)
    sel_index = j
    ) ; end unless
    ) ; end foreach
    (setq haha film_order[sel_index])
    if(sel_index != 0 then
    current_prev = film_order[sel_index-1]
    else (setq current_prev nil) final_list = val); end if
    unless(current_prev == nil
    for(key 0 sel_index-2
    prev_list = append(prev_list list(film_order[key]))
    ); end for
    for(key sel_index+1 length(brd_films)-1
    next_list = append(next_list list(film_order[key]))
    ) ; end for
    unless(sel_index-2 == -1
    final_list = append(prev_list final_list)
    ) ; end unless
    final_list = append(final_list list(haha))
    final_list = append(final_list list(current_prev))
    unless((sel_index+1 > length(brd_films)-1)
    final_list = append(final_list next_list)
    ) ; end unless
    ) ; end unless
    ) ; end if
    axlFormListDeleteItem(myform, "FILMS_LIST" val)
    if(final_list == nil then (setq final_list val))
    axlFormListAddItem(myform, "FILMS_LIST" final_list 0)
    (setq val final_list)
    if(sel_index > 0 then
    axlFormListSelect(myform "FILMS_LIST" sel_index-1)
    else
    axlFormListSelect(myform "FILMS_LIST" 0)
    )
    ("DOWN"

    Thanks

      

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • EvanShultz
    EvanShultz over 9 years ago

    Hi Johnny,

    I copied Ole's solution and it works for me in 16.6 and 17.2. I don't see how to attach a random file here but I tried making it a media file. May not work. If you contact me at evan.shultz@qsc.com I'll send it to you.

    Cheers!

    film_reorder.zip

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
<
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information