#usage "en: Draws the calculated contours of a polygon as WIRE.

" "RUN cmd-draw-polygon-contours-as-wire SIGNALNAME [FILLING] [Layernumber]

" "FILLING also draws the filling as wire.
" "Layernumber the new layer of copy.
" "support@cadsoft.de" , "de: Zeichnet die berechneten Konturen eines Polygons als WIRE.

" "RUN cmd-draw-polygon-contours-as-wire SIGNALNAME [FILLING] [Layernumer]
" "FILLING zeichnet auch die Füllung als WIRE.

" "Layernumber ist der Layer in dem die Kopie erzeugt werden soll.
" "support@cadsoft.de" string Version = "1.0.0"; // 2011-09-07 alf@cadsoft.de string f; string tempextension = "~.scr"; int Ratsnest = 0; int Newlayer = strtol(argv[3]); if (!argv[1]) { if (language() == "de") dlgMessageBox(usage + "

Geben Sie einen SIGNALNAMEN an.", "OK"); else dlgMessageBox(usage + "

Missing SIGNALNAME.", "OK"); exit(-1); } if (board) { board(B) { f = filesetext(B.name, tempextension); output(f, "wtD") { printf("GRID MM;\nSET WIRE_BEND 2;\n"); B.signals(S) { if (S.name == strupr(argv[1]) ) { S.polygons(P) { if (P.layer == 1 || P.layer == 16) { printf("CHANGE LAYER %d;\nCHANGE WIDTH %.4f;\n", P.layer, u2mm(P.width) ); if (P.thermals) printf("CHANGE THERMAL ON;\n"); else printf("CHANGE THERMAL OFF;\n"); P.fillings(W) { Ratsnest = 1; break; } if (!Ratsnest) { if (language() == "de") dlgMessageBox("!Starten Sie zuerst RATSNEST um die Füllung der Polygone zu berechnen.", "OK"); else dlgMessageBox("!Start first RATSNEST to calculate polygons.", "OK"); exit("RATSNEST"); } P.contours(W) { if (Newlayer) printf("Layer %d;\nWIRE (%.4f %.4f) (%.4f %.4f);\n", Newlayer, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2) ); else printf("WIRE '%s' (%.4f %.4f) (%.4f %.4f);\n", S.name, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2) ); } if (argv[2] == "FILLING") P.fillings(W) { if (Newlayer) printf("Layer %d;\nWIRE (%.4f %.4f) (%.4f %.4f);\n", Newlayer, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2) ); else printf("WIRE '%s' (%.4f %.4f) (%.4f %.4f);\n", S.name, u2mm(W.x1), u2mm(W.y1), u2mm(W.x2), u2mm(W.y2) ); } } } } } } } exit("SCRIPT '" + f + "'"); }