• 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. Overrighting attributes of user defined property for a component...

Stats

  • Replies 5
  • Subscribers 160
  • Views 13660
  • Members are here 0
More Content

Overrighting attributes of user defined property for a component.

Wale
Wale over 10 years ago

Hi,

I am working a skill script ... as simple as it should be .. i think i am missing something ....  can someone help look into this ????

The script is supposed to call a .txt file which contains list of Refdes and MPN of components... So for each components on the brd file, the script will parse through each on-board component's Refdes and compare it with the Refdes from the list ( one at a time) and if they match, will replace the attribute of a user defined properties (ASI_MODEL)

E.g.... Component  R12 has property ASI_MODEL = H12345 - 001.... will have its property attribute(H12345 - 001)  replaced by the attribute from the file input ( txt file ).. H00000 - 002

Thanks: Wale

xlCmdRegister("rfl" 'RBG_replace_refdes_list ?cmdType "INTERACTIVE" )
defun( RBG_replace_refdes_list ( @optional refdes_ps )
prog( list(refdes_file r_via l_comp_refdes l_comp_ipn)
mypopup = axlUIPopupDefine( nil (list (list "Done" 'refdes_Done)))
axlUIPopupSet( mypopup)

unless(refdes_ps
refdes_file = axlDMFileBrowse("ALLEGRO_TEXT" nil)
if(isFile(refdes_file) then
refdes_data = axlDMOpenFile("ALLEGRO_TEXT" refdes_file "r")


when(refdes_data
axlSetFindFilter(?enabled '(noall components) ?onButtons '(components))




while(l_refdes = lineread(refdes_data)
r_via = nil
l_comp_refdes=nth(0 l_refdes)
l_comp_ipn = sprintf( nil "%L", nth(1 l_refdes))
axlClearSelSet()

println(l_comp_refdes)


foreach(item comp_dbid
comp_refdes = item->name
comp_ipn = item->compdef->prop->PART_NUMBER

if(l_comp_refdes == comp_refdes
then

l_comp_ipn = comp_ipn

println(l_comp_ipn)
println(type(l_comp_ipn))

comp_prop = axlDBGetProperties(item '("user" "allegro"))

if(car(comp_prop) != "ASI_MODEL"
then
comp_prop = axlDBAddProp(item list("ASI_Model", l_comp_ipn))
else
comp_prop = axlDBAddProp(item list("ASI_Model", l_comp_ipn))

)

)



);endforeach




);endwhile
);endwhen
axlDMClose(refdes_data)
return(t)
else
axlMsgPut(list("File %s could not be found.\n" 3) refdes_file)
return(nil)
);endif
);end unless

);endprog

);enddefun

defun(refdes_Done ()
axlFinishEnterFun()
axlUIPopupSet(nil) ;Remove our popup menu.
)

  • Sign in to reply
  • Cancel
Parents
  • Wale
    Wale over 10 years ago
    Thanks for your reply Dave..... your first comment helped greatly.... so .. i am trying to compare two strings @ line if(l_comp_refdes == comp_refdes...... these are two variable having string values in them and i am trying to compare them ...... my script would not parse through this point.... is there another way of comparing variables with string values in them ?thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Wale
    Wale over 10 years ago
    Thanks for your reply Dave..... your first comment helped greatly.... so .. i am trying to compare two strings @ line if(l_comp_refdes == comp_refdes...... these are two variable having string values in them and i am trying to compare them ...... my script would not parse through this point.... is there another way of comparing variables with string values in them ?thanks
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
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