#usage "[de]Change Via by Stack (Start-Layer End-Layer)
"
"
"
"RUN change-via-by-stack 1 2
"
"RUN change-via-by-stack 1 2 0.1 0.15
"
"RUN change-via-by-stack 1 2 0.1 0.15 SQUARE
"
"RUN change-via-by-stack 1 2 no square
"
"RUN change-via-by-stack 1 2 1-16 STACK
"
"Ändert Drill, Durchmesser, Shape bzw. Stacktiefe (Via-Länge) von Vias mit angegebener Stacktiefe.
"
"Wird die Option Drill bzw. Diameter nicht angegeben, so werden die "
"aktuell eingestellten (zuletzt mit CHANGE geänderten) Werte benutzt.
"
"Wird Shape nicht angegeben, bleibt die Form unverändert.
"
"Soll Drill bzw. Diameter nicht geändert werden, geben Sie die Option NO vor Shape an. "
"NO darf nicht angegeben werden, wenn Drill oder Diameter benutzt wird.
"
"Vor der Option STACK muß die neue Stacktiefe Start-End (z.B. 2-15) angegeben werden.
"
"Die Optionen können groß oder klein geschrieben werden."
"
"
"
"
"Changes drill, diameter, shape or via stack (via length) of vias with a given via stack.
"
"If the options Drill and/or Diameter are not used, the ULP will take the "
"currently valid values (previously set with the CHANGE command).
"
"If the Shape option is not given, the via shapes stay unchanged.
"
"If you want to have Drill and Diameter unchanged, use the option NO "
"before the Shape option.
"
"You must not use NO, if Drill or Diameter are to be changed.
"
"Define the new via stack Start-End (for example: 2-15) before the STACK option.
"
"Upper or lower case letters does not matter here."
"
"
"
" + Version, "OK"); exit(-1); } if (argc == 5) { stack = strupr(argv[4]); if (stack == "STACK") new_stack = argv[3]; else stack = ""; } if (!stack) { v_shape = strupr(argv[argc-1]); if (v_shape == "ROUND" || v_shape == "SQUARE" || v_shape == "OCTAGON"); else v_shape == ""; } board(B) { script = filesetext(B.name, ".scr"); output(script, "wtD") { // temporäres file set_layer(); B.signals(S) { S.vias(V) { if (V.start == via_start && V.end == via_end) { if (stack) printf("CHANGE VIA %s (%.4f %.4f);\n", new_stack, u2mm(V.x), u2mm(V.y) ); else { if (v_shape) printf("CHANGE SHAPE %s (%.4f %.4f);\n", v_shape, u2mm(V.x), u2mm(V.y) ); if (strupr(argv[3]) != "NO") { if (v_drill) printf("CHANGE DRIL %.4f (%.4f %.4f);\n", v_drill, u2mm(V.x), u2mm(V.y) ); else printf("CHANGE DRIL (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) ); if (v_diam) printf("CHANGE DIAM %.4f (%.4f %.4f);\n", v_diam, u2mm(V.x), u2mm(V.y) ); else printf("CHANGE DIAM (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) ); } } } } } printf("GRID LAST;\n"); printf("DISPLAY NONE "); B.layers(L) if (L.visible) printf(" %d", L.number); printf(";\n"); } } dlgDialog("test") { string text; int t = fileread(text, script); dlgTextEdit(text); dlgHBoxLayout { dlgPushButton("OK") dlgAccept(); dlgPushButton("esc") { dlgReject(); exit(-1); } dlgStretch(1); } }; exit("SCRIPT '" + script + "'\n"); } else { dlgMessageBox("Start this ULP in a Board", "OK"); exit(0); }