#usage "Show-NetClass-By-Layer\n" "

" "This ULP runs in a schematic and defines the layers 190 Class0, 191 Class1, ... 197 Class7. " "It then draws (or traces) wires on the layer corresponding to the class of every net. " "Once nets are drawn, moved or deleted the wires on the Class_ layers should be deleted and the ULP re-run" "

" "Author: Neil Allison, neil@avon-tech-solutions.co.nz\n" /* Rev History File: Show-NetClass-By-Layer.ulp Author: Neil Allison, Avon Technical Solutions, PO Box 20350, Christchurch, New Zealand email: neil@avon-tech-solutions.co.nz (C) Copyright, Neil Allison, 2003, All rights reserved. Date: 18-Feb-2004 NJA Original, tested ver Win 4.09r1 */ //USER DEFINED VARIABLES //Edit the variables below to change the wire width, first layer and maximum number of classes int classStartLayer = 190; //Class 0 (default) Layer, use next 7 from here on int wireWidth = 6; //Wire Width (mil) int maxClass =7; //Main if (schematic) { string ulp_path; int position = strrchr(argv[0], '/'); if (position >= 0) { ulp_path = strsub(argv[0], 0, position + 1); } output(ulp_path + "ShowNetClassByLayer.scr", "wt") { printf("Set wire_bend 2;\n"); printf("Grid mil;\n"); printf("Change Width %u;\n", wireWidth); printf("Grid Last;\n"); printf("Grid mic;\n"); //Define Class Layers (e.g. 190 Class0) and Colours int classColour; for (int j = classStartLayer; j <= (classStartLayer+maxClass); ++j){ printf("Layer %u Class%u;\n", j, (j - classStartLayer)); switch (j-classStartLayer) { case 0: classColour = 11; break; //Cyan case 1: classColour = 6; break; //Brown case 2: classColour = 12; break; //Red case 3: classColour = 7; break; //Grey (no orange) case 4: classColour = 14; break; //Yellow case 5: classColour = 10; break; //Green case 6: classColour = 1; break; //Dark Blue case 7: classColour = 5; break; //Purple (Violet) default : classColour = 9; //Blue - shouldn't be any this colour } printf("Set COLOR_LAYER %u %u;\n", j, classColour); } //Trace Wires over Nets by Class / Sheet / Net /Segment / Wire int sheetCount; for (int i = 0; i<=maxClass; ++i){ sheetCount = 1; printf("Layer %u ;\n",i + classStartLayer); schematic(Sch) { Sch.sheets(Sht) { printf("Edit .s%u;\n",sheetCount); Sht.nets(Net) { if (i == Net.class.number) { Net.segments(Seg) { Seg.wires(Wire) { printf("Wire (%6.0f %6.0f) (%6.0f %6.0f);\n", u2mic(Wire.x1), u2mic(Wire.y1), u2mic(Wire.x2), u2mic(Wire.y2)); } } } } sheetCount++; } } } printf("Grid Last;\n"); } exit("; SCR '" + ulp_path + "ShowNetClassByLayer.scr';\n"); } else { dlgMessageBox("\n Please run Show-NetClass-By-Layer.ulp in a Schematic \n"); exit (0); }