DIRECTORY CD, CDCells, CDCommandOps, CDIO, CDOps, CDSequencer, Core, CoreOps, Rope, SinixOps, Sisyph, TerminalIO, SpiceOps; SpiceCDCmds: CEDAR PROGRAM IMPORTS CDCells, CDCommandOps, CDIO, CDOps, CoreOps, Rope, SinixOps, Sisyph, TerminalIO, SpiceOps = BEGIN ROPE: TYPE = Rope.ROPE; ExtractSelectedObjAndSpiceIt: PROC [comm: CDSequencer.Command] = { selected: CD.Instance; multiple: BOOL; cellType: Core.CellType; wDir: ROPE _ CDIO.GetWorkingDirectory[comm.design]; fileName: ROPE; [selected, multiple] _ CDOps.SelectedInstance[comm.design]; IF ~IsSingleSelectedAndCell[selected, multiple] THEN RETURN; cellType _ NARROW [SinixOps.ExtractCDInstance[selected, comm.design, Sisyph.mode].result]; WHILE SinixOps.IsIcon[Sisyph.mode.decoration, cellType] DO cellType _ CoreOps.Recast[cellType]; ENDLOOP; IF CoreOps.GetCellTypeName[cellType]=NIL THEN fileName _ Rope.Cat[wDir, "SpiceInputDeck.spice"] ELSE fileName _ Rope.Cat[wDir, CoreOps.GetCellTypeName[cellType], ".spice"]; SpiceOps.WriteSpiceDeck[cellType, fileName]; }; IsSingleSelectedAndCell: PROC [selected: CD.Instance, multiple: BOOL] RETURNS [BOOL] = { IF ~IsSingleSelected[selected, multiple] THEN RETURN [FALSE]; IF ~CDCells.IsCell[selected.ob] THEN { TerminalIO.PutRope["\n** Selected instance is not a cellcan't do it.\n"]; RETURN[FALSE]; }; RETURN[TRUE]; }; IsSingleSelected: PROC [selected: CD.Instance, multiple: BOOL] RETURNS [BOOL] = { IF selected=NIL THEN { TerminalIO.PutRope["\n** No current selection--can't do it.\n"]; RETURN[FALSE]; }; IF multiple THEN { TerminalIO.PutRope["\n** Multiple instances selected--can't do it.\n"]; RETURN[FALSE]; }; RETURN[TRUE]; }; CDCommandOps.RegisterWithMenu[menu: $OtherProgramMenu, entry: "Sisyph -> Spice", proc: ExtractSelectedObjAndSpiceIt, key: $ExtractToSpice] END. €SpiceCDCmds.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Created by Pradeep Sindhu, March 31, 1986 6:25:43 pm PST Pradeep Sindhu, April 29, 1986 0:19:46 am PDT Bertrand Serlet October 17, 1986 10:46:42 pm PDT Christian Jacobi, January 7, 1987 2:58:17 pm PST Christian LeCocq February 6, 1987 4:24:14 pm PST Command Procs Internal Utilities Initialization Κc˜šœ™Jšœ Οmœ1™