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];
};