📄 film_reorder.il
字号:
/*
################################################################################
# #
# Command: film_reorder #
# Skill File: film_reorder.il #
# How To Load: Command> skill load("film_reorder.il") #
# How To Execute: Command> film_reorder #
# Sourcelink Solution Reference : 11297786 #
# #
# Author: Jatin Sasan , Cadence Design Systems #
# Email: jsasan@cadence.com #
# Creation Date: 09/12/2006 #
# #
################################################################################
################################################################################
# #
# DISCLAIMER: #
# THIS CODE IS UNSUPPORTED AND HAS HAD MINIMAL TESTING. #
# The following code is provided for Cadence customers #
# to use at their own risk. The code may require modification to #
# satisfy the requirements of any user. The code and any #
# modifications to the code may not be compatible with current or #
# future versions of Cadence products. #
# THE CODE IS PROVIDED "AS IS" AND WITH NO WARRANTIES, INCLUDING #
# WITHOUT LIMITATION ANY EXPRESS WARRANTIES OR IMPLIED WARRANTIES #
# OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. #
# #
################################################################################
################################################################################
# #
# 09/12/2006: Pops a UI where you can load films and reorder them through #
# Up and Down buttons
# Revision history: #
# 1.0 Original file Sept 12,2006 #
# 1.1 Fixed Mirror and Shape fill bug. Options were
# getting set incorrectly in reverse order Dec 17, 2006 #
# #
# Advantages: #
# a) Easy to Reorder films.
# b) Preserves the artwork film layer settings #
# #
# #
# Limitations: #
# a) Artwork film layer settings for undefined line width, Shape Bounding #
# box and XY offset are not preserved. They are reset to default on #
# reordering. #
################################################################################
*/
axlCmdRegister("film_reorder" 'film_reorder)
declare(film_array[50])
declare(film_order[50])
(setq brd_films nil)
unless(axlGetVariable("film_nosort") ;Allegro by default sorts the film records in Artwork control form
axlSetVariable("film_nosort" t) ;Setting this env variable turns off the default sorting.
) ; end unless
procedure( film_reorder()
_makeForm_artwork_reorder()
axlFormDisplay(_Form_artwork)
); end procedure
;###########################################################
;# #
;# FORM CREATION #
;# #
;###########################################################
(defun _makeForm_artwork_reorder ()
_Form_artwork=outfile("./form_artwork.form" "w")
fprintf(_Form_artwork "FILE_TYPE=FORM_DEFN VERSION=2\n")
fprintf(_Form_artwork "FORM\n")
fprintf(_Form_artwork "FIXED\n")
fprintf(_Form_artwork "PORT 55 18\n")
fprintf(_Form_artwork "HEADER \"Artwork Film Re-ordering\" \n")
fprintf(_Form_artwork "TILE\n")
fprintf(_Form_artwork "TEXT \"Existing Films in Brd:\"\n")
fprintf(_Form_artwork "TLOC 4 2\n")
fprintf(_Form_artwork "ENDTEXT\n")
fprintf(_Form_artwork "FIELD FILMS_LIST\n")
fprintf(_Form_artwork "FLOC 20 2\n")
fprintf(_Form_artwork "LIST \"\" 20 7\n")
fprintf(_Form_artwork "OPTIONS multiselect\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "FIELD LOAD\n")
fprintf(_Form_artwork "FLOC 4 6\n")
fprintf(_Form_artwork "MENUBUTTON \"Load Films\" 12 3\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "FIELD UP\n")
fprintf(_Form_artwork "FLOC 45 2 \n")
fprintf(_Form_artwork "MENUBUTTON \"Up\" 6 3\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "FIELD DOWN\n")
fprintf(_Form_artwork "FLOC 45 6\n")
fprintf(_Form_artwork "MENUBUTTON \"Down\" 6 3\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "FIELD DONE\n")
fprintf(_Form_artwork "FLOC 10 16 \n")
fprintf(_Form_artwork "MENUBUTTON \"Re-order\" 12 3\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "FIELD CANCEL\n")
fprintf(_Form_artwork "FLOC 35 16\n")
fprintf(_Form_artwork "MENUBUTTON \"Close\" 12 3\n")
fprintf(_Form_artwork "ENDFIELD\n")
fprintf(_Form_artwork "ENDTILE\n")
fprintf(_Form_artwork "ENDFORM\n")
close(_Form_artwork)
_Form_artwork = axlFormCreate( (gensym) "form_artwork.form" '(e inner) 'artwork_callback t)
); end defun _makeForm_artwork_reorder
procedure(artwork_callback(myform)
let( (prev_list final_list )
case( myform->curField
("FILMS_LIST"
/* Nothing to do */
)
("LOAD"
axlFormListDeleteItem(myform, "FILMS_LIST" brd_films)
(setq brd_films nil)
film_count = get_film_list()
for(key 0 film_count-1
brd_films = append(brd_films list(film_array[key]->film_name))
)
axlFormListAddItem(myform, "FILMS_LIST" brd_films 0)
val = brd_films
)
("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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -