Hi All,
I encountered this error when i ran this script from Allegro Command Line Interface .... "/////// E- *Error* nth: argument #2 should be a list (type template = "xl") - t /////// "
The script should call a list (.txt file) that contains via coordinates, padstacks and net-names. Delete any existing via in that coordinate on a brd file. Create via using information form the list and Add a PROPERTY " RETAIN_NET_ON_VIAS" and set it to "TRUE"
Thanks in Advance.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
axlCmdRegister("cvr" 'RBG_replace_via_list ?cmdType "INTERACTIVE" )
defun( RBG_replace_via_list ( @optional v_ps )
prog( list(via_file r_via l_loc t_padstk p_netname )
mypopup = axlUIPopupDefine( nil (list (list "Done" `cvr_Done)))
axlUIPopupSet( mypopup)
unless(v_ps ;unless a padstack is supplied get a file.
via_file = axlDMFileBrowse("ALLEGRO_TEXT" nil)
if(isFile(via_file) then
via_data = axlDMOpenFile("ALLEGRO_TEXT" via_file "r") ;open the list file
;l_visible = axlVisibleGet() ;store visibility settings
;axlVisibleDesign(nil) ;set design invisible
when(via_data
axlSetFindFilter(?enabled '(noall vias) ?onButtons '(vias))
while(l_via = lineread(via_data) ;read a line of data
r_via = nil
l_loc=nth(0 l_via) ;store the via location
t_padstk=sprintf(nil "%s", nth(1 l_via)) ;store the padstack name
p_netname=nth(2 l_via) ;store padstack netname
prop_name=nth(3 l_via)
prop_value=nth(4 l_via)
axlClearSelSet()
axlAddSelectPoint(l_loc) ;select the via
sel_via = car(axlGetSelSet())
axlClearSelSet()
if(sel_via then
via_net = sel_via->net ;store the net the via is connected to
via_net = p_netname ;replace net name on list with via net name
axlDeleteObject(sel_via) ;delete original via
errset(axlDBCreateVia(t_padstk,l_loc,via_net,nil,0,nil)) ; create a vias with given padstack, location, netname
axlDBAddProp( axlGetSelSet(), list("RETAIN_NET_ON_VIAS", "TRUE"))
sel_via = nil
else
printf("Via not found at %L\n" l_loc)
);endif
);endwhile
);endwhen
axlDMClose(via_data)
return(t)
else
axlMsgPut(list("File %s could not be found.\n" 3) via_file)
return(nil)
);endif
);end unless
);end prog
);end defun
defun(cvr_Done ()
axlFinishEnterFun()
axlUIPopupSet(nil) ;Remove our popup menu.
)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////