public void Execute(PCBI.Automation.IPCBIWindow parent) { parent.MainForm.KeyPress += MainForm_KeyPress; parent.ZoomHome(); //example work to highlight pins of gnd net IStep curStep = parent.GetCurrentStep(); if (curStep == null) { return; } IMatrix matrix = parent.GetMatrix(); parent.UIAction.Execute(ID_ActionItem.ID_ALL_LAYER_OFF); List <string> layernames = matrix.GetAllLayerNames(); int count = layernames.Count; int loopLayer = 0; loopLayer = layernames.IndexOf(matrix.GetTopSignalLayer()); while (true) { Thread.Sleep(1000); if (isDisposed) { break; } if (pause) { continue; } if (loopLayer > 0) { curStep.GetLayer(layernames[loopLayer - 1]).DisableLayer(); } curStep.GetLayer(layernames[loopLayer]).EnableLayer(true); parent.UpdateView(); loopLayer++; if (loopLayer > count) { break; } if (loopLayer > layernames.IndexOf(matrix.GetBotSignalLayer())) { break; } } }
public void Execute(PCBI.Automation.IPCBIWindow parent) { //do work here bool exampleColorReset = true; while (true) { Thread.Sleep(1000); if (isDisposed) { break; } //example work to highlight pins of gnd net IStep curStep = parent.GetCurrentStep(); if (curStep == null) { return; } ICMPLayer topLayer = curStep.GetCMPLayer(true); if (topLayer == null) { continue; } foreach (ICMPObject cmp in topLayer.GetAllLayerObjects()) { foreach (IPin pin in cmp.GetPinList()) { if (pin.GetNetNameOnIPin(cmp).ToLowerInvariant().Contains("gnd")) { if (exampleColorReset) { pin.ResetPinColor(cmp); } else { pin.SetPinColor(System.Drawing.Color.Aqua, cmp); } } } } exampleColorReset = !exampleColorReset; parent.UpdateView(); } }