• 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. REF DES Moving By Symbol.

Stats

  • Replies 0
  • Subscribers 160
  • Views 13469
  • Members are here 0
More Content

REF DES Moving By Symbol.

karthikeyan123
karthikeyan123 over 5 years ago

Hai,

I want to move my group of  refdes in silkscreen by selecting the symbols I modified one relevant code but it is not working hope any one help me please I am new to skill. i'll attach the code below and also sample image.

Images:

1. Selecting image

2. Paste Refdes Alone:

Skill code:

axlCmdRegister("moveRefdes", 'moveRefdes, ?cmdType "general")
axlCmdRegister("moveRefdes_OneShot", 'moveRefdes1, ?cmdType "general")
defun( moveRefdes (@optional refdes)
 moveRefdesStart(refdes)
)
defun( moveRefdes1 (@optional refdes)
 moveRefdesStart(refdes, t)
)
defun( moveRefdesStart (refdes @optional oneShot)
 let((sym, popup, alias_m, alias_r, pt, (continue t), event, refdes2)
 axlSetFindFilter(?enabled '("NOALL" "SYMBOLS") ?onButtons '("SYMBOLS"))
 unless(oneShot, defvar(MBRD_mark))
 defvar(MBRD_ang)
 defvar(MBRD_mir)
 defvar(MBRD_dAng 0)
 defvar(MBRD_dMir)
 axlSelect(?prompt "Select Symbols")
 unless(refdes, refdes = axlGetSelSet())
 axlClearSelSet() 
 foreach( refdes2 refdes
 if(refdes && (sym = car(setof(obj, refdes2 ->children, obj ->layer == "REF DES/SILKSCREEN_TOP"))) then
  popup = if(oneShot then
   axlUIPopupDefine(nil '(
    ("Done", "axlFinishEnterFun()")
    ("Cancel", "axlCancelEnterFun()")
    ("MENU_SEPARATOR", nil)
    ("Mirror", "(moveByRefdes_mirror)")
    ("Rotate", "(moveByRefdes_rotate)")
   ))
   else
   axlUIPopupDefine(nil '(
    ("Done", "axlDBTransactionCommit(MBRD_mark), axlFinishEnterFun()")
    ("Oops", "axlDBTransactionOops(MBRD_mark)")
    ("Cancel", "axlDBTransactionRollback(MBRD_mark), axlCancelEnterFun()")
    ("MENU_SEPARATOR", nil)
    ("Mirror", "(moveByRefdes_mirror)")
    ("Rotate", "(moveByRefdes_rotate)")
   ))
  )
  axlUICmdPopupSet(popup)
  alias_m = axlGetAlias("m")
  alias_r = axlGetAlias("r")
  axlShell("funckey m \"(moveByRefdes_mirror)\"")
  axlShell("funckey r \"(moveByRefdes_rotate)\"")
  unless(oneShot, MBRD_mark = axlDBTransactionStart())
  MBRD_ang = round(sym ->rotation)
  MBRD_mir = sym ->isMirrored
  axlDynamicsObject(sym, sym ->xy)
  ;Add rats:
  foreach(pin, sym ->pins
   pt = list(car(pin ->xy) - car(sym ->xy), cadr(pin ->xy) - cadr(sym ->xy))
   foreach(ratPin, mapcar(lambda((objPair), car(remove(pin, objPair))), setof(objPair, _fpUtilGetNetRats(pin), member(pin, objPair)))
    axlAddSimpleRbandDynamics(ratPin ->xy, "directline", ?origin pt, ?var_point pt ?color 'ratsnestColor)
   )
  )
  while(continue
   event = axlEnterEvent(list('PICK), nil, t)
   caseq(event ->type
    (PICK
     sym = sym = car(setof(obj, refdes2 , obj ->layer == "REF DES/SILKSCREEN_TOP"))
     refdes = sym ->children
     unless(oneShot, axlDBTransactionMark(MBRD_mark))
     axlClearSelSet()
     axlDeleteObject(sym)
     sym = car(axlDBCreateSymbol(refdes, event ->xySnap, MBRD_mir, MBRD_ang))
     when(oneShot
      continue = nil
      axlFinishEnterFun()
     )
    )
    (DONE, continue = nil)
    (CANCEL, continue = nil)
   ); caseq
  ); while continue
  axlClearDynamics()
  axlSetAlias("m", alias_m)
  axlSetAlias("r", alias_r)
  else
  when(refdes, axlMsgPut(list("Reference Designator %s not found", 3), refdes))
 );if sym
)))
defun( moveRefdes_mirror ()
 MBRD_mir = !MBRD_mir, MBRD_dMir = !MBRD_dMir
 MBRD_ang = mod(-MBRD_ang, 360), MBRD_dAng = mod(-MBRD_dAng, 360)
 if(isCallable('axlSetDynamicsMirror), axlSetDynamicsMirror(MBRD_dMir), _axlSetDynamicsMirror(MBRD_dMir))
 if(isCallable('axlSetDynamicsRotation), axlSetDynamicsRotation(MBRD_dAng), _axlSetDynamicsRotation(MBRD_dAng))
)
defun( moveRefdes_rotate ()
 MBRD_ang = mod(MBRD_ang + if(MBRD_mir, -90, 90), 360), MBRD_dAng = mod(MBRD_dAng + if(MBRD_mir, -90, 90), 360)
 if(isCallable('axlSetDynamicsRotation), axlSetDynamicsRotation(MBRD_dAng), _axlSetDynamicsRotation(MBRD_dAng))
)
  • 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