public void Execute(IPCBIWindow PCBI_Host) { PCBI_Host.LoadODBJob(@"D:\jobs\examples\odbjob"); //this works only if the location exists and the folder contains an odb++ design! IStep step = PCBI_Host.GetStep("pcb"); //the step name must be correct to find the step with this method. if (step == null) { return; } step.ActivateStep(); }
public void Execute(IPCBIWindow parent) { string pathForWorkingODB = Path.GetTempPath() + "example\\WorkingJob"; parent.SaveJob(pathForWorkingODB, false); if (!parent.LoadODBJob(pathForWorkingODB)) { MessageBox.Show("Can't create a temporary working copy of ODB-Data.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("Workingcopy is loaded.", "Finish", MessageBoxButtons.OK, MessageBoxIcon.None); } }
private DialogResult MakeWorkingCopy() { DialogResult res = DialogResult.Abort; string stepName = this.Parent.GetCurrentStep().Name; string pathForWorkingODB = Path.GetTempPath() + "NBI\\" + Parent.GetJobName() + "_" + stepName + DateTime.Now.Ticks + "\\"; if (Directory.Exists(pathForWorkingODB)) { Directory.Delete(pathForWorkingODB, true); System.Threading.Thread.Sleep(400); } Parent.SaveJob(pathForWorkingODB, false); if (!Parent.LoadODBJob(pathForWorkingODB)) { MessageBox.Show("Can't create a temporary working copy of ODB-Data.", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); } else { //res = MessageBox.Show("Continue", "Workingcopy is loaded", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); return(DialogResult.OK); } return(res); }
public void Execute(IPCBIWindow parent) { //remove all informations of developing string pathForWorkingODB = System.IO.Path.GetTempPath() + "\\example\\WorkingJob" + DateTime.Now.DayOfYear; parent.SaveJob(pathForWorkingODB, false); if (!parent.LoadODBJob(pathForWorkingODB)) { MessageBox.Show("Can't create a temporary working copy of ODB-Data.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } IStep step = parent.GetCurrentStep(); if (step == null) { return; } int counter = 1; foreach (INet net in step.GetNets()) //change netnames { net.NetName = "Net_" + counter; net.ComponentList = new List <INetObject>(); counter++; } IMatrix matrix = parent.GetMatrix(); if (matrix == null) { return; } foreach (string layername in step.GetAllLayerNames()) { if (matrix.GetMatrixLayerType(layername) == MatrixLayerType.Component || matrix.GetMatrixLayerType(layername) == MatrixLayerType.Document) { matrix.DelateLayer(layername, true); //remove components and document from the matrix. } } foreach (IPackageSpecifics pack in step.GetAllPackages()) //destroy packages { pack.SetGraphicsPath(new System.Drawing.Drawing2D.GraphicsPath()); pack.SetOutline(pack.CreatePolygonPinSurface()); } parent.SaveJobImperative(); parent.UpdateControlsAndResetView(); SaveFileDialog saveEmbedded = new SaveFileDialog(); saveEmbedded.FileName = "embeddedJob.zip"; if (saveEmbedded.ShowDialog() == System.Windows.Forms.DialogResult.OK) { parent.SaveEmbeddedAsZIP(saveEmbedded.FileName); } }