;axlCmdRegister("moveByRefdes", 'moveByRefdes, ?cmdType "general") defun( moveByRefdes (refdes) let((sym, popup, alias_m, alias_r, ang, (dAng 0), dMir, mir, mark, (continue t), event) sym = car(axlSelectByName("SYMBOL", refdes)) if(sym then popup = axlUIPopupDefine(nil '( ("Done", "axlDBTransactionCommit(mark), axlFinishEnterFun()") ("Oops", "axlDBTransactionOops(mark)") ("Cancel", "axlDBTransactionRollback(mark), axlFinishEnterFun()") ("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)\"") mark = axlDBTransactionStart() ang = round(sym ->rotation) mir = sym ->isMirrored axlDynamicsObject(sym, sym ->xy) while(continue event = axlEnterEvent(list('PICK), nil, t) caseq(event ->type (PICK sym = car(axlSelectByName("SYMBOL", refdes)) axlDBTransactionMark(mark) axlClearSelSet() axlDeleteObject(sym) sym = car(axlDBCreateSymbol(refdes, event ->xySnap, mir, if(mir, -ang, ang))) ) (DONE, continue = nil) (CANCEL, continue = nil) ); caseq ); while continue axlClearDynamics() axlSetAlias("m", alias_m) axlSetAlias("r", alias_r) else axlMsgPut(list("Reference Designator %s not found", 3), refdes || "*** Not supplied ***") );if sym )) defun( moveByRefdes_mirror () mir = !mir, dMir = !dMir, _axlSetDynamicsMirror(dMir)) defun( moveByRefdes_rotate () ang = mod(ang + 90, 360), dAng = mod(dAng + 90, 360), _axlSetDynamicsRotation(dAng))