Format Board to Match Schematic

Format Board to Match Schematic

Anonymous
Not applicable
472 Views
1 Reply
Message 1 of 2

Format Board to Match Schematic

Anonymous
Not applicable

Is there a way to automatically format parts in the board to be in the same position as they are on the schematic? I have probably around a hundred components in a schematic, which are all a jumble on the board. Do I need to manually move each piece into position one by one, or can I automatically format it? I am running Eagle 9.5.1.

0 Likes
473 Views
1 Reply
Reply (1)
Message 2 of 2

Yura.Ivanov.VLuki
Collaborator
Collaborator

autoplace_v3.ulp

/* 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);