• 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. Add Property to Via

Stats

  • Replies 6
  • Subscribers 159
  • Views 15383
  • Members are here 0
More Content

Add Property to Via

Wale
Wale over 9 years ago

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.
)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

  • Sign in to reply
  • Cancel
  • eDave
    eDave over 9 years ago

    t will be returned from lineread if the line read in is blank. Check your input file.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Wale
    Wale over 9 years ago
    Thanks Dave. My input file had an empty row.
    Also, The property "RETAIN_NET_ON_VIAS" is not added to the vias i created.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 9 years ago
    RETAIN_NET_ON_VIAS is a net property. It can't be assigned to a via as far as I can see.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Wale
    Wale over 9 years ago
    Thanks Dave for your support in the debug. I do appreciate it. It doesn't seem to me my script is broken. I used another property name and still the script did not assign it to the via. am i doing something wrong? Kindly help.. thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 9 years ago
    To use a custom property name you will have to define the property definition first. Use axlDBCreatePropDictEntry.
    • 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