/* Simple autoplace ulp based upon component position in schematic * this ULp was origianlly written by one of the CADSOFT team I believe * apologies for lack of full reference and acknoledgement * run the ULP in the sch window and run place.scr in BRD * changing the scale parameter will produce tighter/looser grouping * Ideally stick in a pop-up window to select scale and x/y offset at some time */ string c,cmd; real scale = 0.75; int HasPins, IsSupplySymbol, Px, Py, xoffset, yoffset, ix, GridDist = 50, ShOffset = 3000, y_ShOffset = 4000, x_ShOffset = 7500; output("place.scr") { if (schematic) schematic(SCH) { cmd+= "board; \n"; sprintf(c, "Grid mil 50;\n"); cmd+= c; SCH.sheets(S) { S.parts(P) { ix = 0; P.instances(I) { if (ix==0) { Px = round(scale*(u2mil(I.x)) / GridDist) * GridDist; Py = round(scale*(u2mil(I.y)) / GridDist) * GridDist; } HasPins = 0; IsSupplySymbol = 0; I.gate.symbol.pins(PIN) { if ((PIN.direction == PIN_DIRECTION_SUP)) IsSupplySymbol = 1; HasPins = 1; } ix++; } if (HasPins && !IsSupplySymbol) { xoffset = x_ShOffset*trunc(0.5*(S.number-1)); yoffset = y_ShOffset*2*frac(0.5*(S.number-1)); sprintf(c, "Move %s (%d %d);\n", P.name, Px+xoffset, Py+yoffset); cmd+= c; } } // end parts } // end sheets printf("GRID LAST;\n"); printf("RATSNEST;\n"); } } exit(cmd);