element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) Two scripts to help layout a board from a multi-page schematic...
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 12 replies
  • Subscribers 178 subscribers
  • Views 2594 views
  • Users 0 members are here
  • board
  • eagle
  • ulp
  • layout
  • schematic
  • multi-page
Related

Two scripts to help layout a board from a multi-page schematic...

AnalogNotes
AnalogNotes over 11 years ago

Not sure "support" is the best place to put this, but then again, "user chat" doesn't seem to be any better...  image

 

Every design I've done has multiple schematic pages.  It's easier to work on a particular part of the schematic, plus it looks a lot better when creating graphics/pdfs/printing.  The difficulty appears when starting to layout the corresponding board.  When first creating the board, you get a big pile of parts arranged by the type of part, not by the section or page of the schematic.  It can take a while to deal with all these parts!  Here's an example:

image

I started to look at ULPs that might help.  Jorge Garcia of Cadsoft USA pointed me to the granddaddy of them all, autoplace.ulp (available on http://www.cadsoftusa.com/downloads/ulps as autoplace_v3.ulp) but it is over ten years old and has a couple bugs.  (For example, it writes commands to a script file that never gets called.)  If you type "autoplace" into the search box at the downloads link, you'll see a couple other scripts that look interesting.  Jim Meech uploaded two scripts, aps.ulp and apg.ulp a couple years back.  I downloaded them and gave them a try.  Jim's aps.ulp autoplaces parts one sheet at a time. Here's the output with the default settings:

image

This is better than autoplace.ulp, but I think there's still room for improvement.  Instead of iterating through each schematic sheet and either placing the parts, moving them out of the way, or setting a different location in the script, I decided I wanted my script to sort all of the parts in one step without me having to intervene.  I wrote arrange.ulp and uploaded it to the Cadsoft site ( http://www.cadsoftusa.com/downloads/file/arrange.ulp ).  Arrange.ulp goes through the entire schematic and arranges all the parts in separate piles, one for each page of the schematic.  Here's the output from my eighteen page schematic:


image

Page one is the bottom right, page two is to the left of it.  For this example I have the script set to five columns, so the pile above page one is page six.  With this arrangement, I can group and move all parts from each page easily.  Of course, now I've just divided my original problem into smaller problems.  Depending upon how complicated each page is, there may be a lot of parts in each pile, and to be honest, the way EAGLE works, it's a pain to use the mouse to grab each part from the stack one at a time and move it.  So, I wrote another ULP, distribute.ulp ( http://www.cadsoftusa.com/downloads/file/distribute.ulp ).  Select a pile of parts with the "group" command and run this script and those parts will be moved to a different area of the layout and spread out so that they're easier to select.  Here's the output from running distribute.ulp on the parts from the first pile, my schematic page one:

image

I think it's a lot easier to grab each component and place it on the board this way.

 

NOTES:  Don't run arrange.ulp more than once unless you're trying to completely redo your board from scratch!  The distribute.ulp can be run on any selected group.  Both scripts can be configured to place parts in any quadrant of the board layout that you like.  Since by default the board is created in the top right quadrant of the layout editor, I chose the top left quadrant for the arrange.ulp output, and the bottom right for distribute.ulp.  You can edit the scripts and change the XQuadrant and YQuadrant values to what you prefer.  It's best to have each script output to a different quadrant.  Also, I've heard that there's a problem with generating the scripts under Windows XP, but I don't have an XP system to use for testing.  I wrote these scripts on Windows Vista with EAGLE 5.

 

Let me know what you think!

 

Regards,

Doug

 

Message was edited by: Doug Wellington Element14 lost the first three images, so I reloaded them.

  • Sign in to reply
  • Cancel
  • AnalogNotes
    AnalogNotes over 11 years ago

    Minor correction, it looks like Matthias Weingart's place50.ulp is the granddaddy of them all.  It predates autoplace by about three years.  I can see that autoplace.ulp is a modified version of place50...

     

    FWIW, here are the direct links to all of the scripts:

    place50.ulp

    autoplace_v3

    aps.ulp

    apg.ulp

    arrange.ulp

    distribute.ulp

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago in reply to AnalogNotes

    Doug Wellington wrote:

     

    Minor correction, it looks like Matthias Weingart's place50.ulp is the

    granddaddy of them all.  It predates autoplace by about three years.  I

    can see that autoplace.ulp is a modified version of place50...

     

    FWIW, here are the direct links to all of the scripts:

    place50.ulp (http://www.cadsoftusa.com/downloads/file/place50.zip)

    autoplace_v3 (http://www.cadsoftusa.com/downloads/file/autoplace_v3.ulp)

    aps.ulp (http://www.cadsoftusa.com/downloads/file/aps.ulp)

    apg.ulp (http://www.cadsoftusa.com/downloads/file/apg.ulp)

    arrange.ulp (http://www.cadsoftusa.com/downloads/file/arrange.ulp)

    distribute.ulp">

    (http://www.cadsoftusa.com/downloads/file/distribute.ulp)

     

     

    you might like to add following ULP to your toolbox.

     

     

    #usage "<b>pick-up parts in the board editor that are grouped in the schematic</b>\n"

          "<p>"

          "group parts in the schematic, then run pickGrouped"

          "<p>"

          "<author>Author: lorenznl@yahoo.com</author>"

     

    // THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED

     

     

    void main (void) {

    string gInSch[], cmd;

    int    gCnt, mx, my;

     

       // collect the grouped parts

       project.schematic(SCH) {

         SCH.parts(PAR) PAR.instances (INS) {

           if (PAR.device.package && ingroup(INS))

             gInSch[gCnt++] = PAR.name;

         }

       }

     

       if (gCnt == 0) {

         dlgMessageBox("Nothing grouped in schematic!");

         exit(1);

       }

     

       project.board (B) {

         clrgroup(B);

     

         // regroup the collected parts in the board

         //  and determine center of weight

         B.elements (E) {

           if (lookup(gInSch, E.name, 0) != "") {

             mx += E.x;

             my += E.y;

             setgroup(E);

           }

         }

     

         // pick up the grouped parts at center of weight

         sprintf(cmd, "move (>%.1fmic %.1fmic)", u2mic(mx/gCnt), u2mic(my/gCnt));

         if (project.schematic) cmd = "edit .brd;" + cmd;

         exit(cmd);

       }

    }

    --

     

    Lorenz

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • AnalogNotes
    AnalogNotes over 11 years ago in reply to autodeskguest

    Lorenz,

     

    I like your script.  Have you considered uploading it to the Cadsoft web site?

     

    http://www.cadsoftusa.com/downloads/upload

     

    Doug

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago in reply to AnalogNotes

    Hi Doug,

     

    Doug Wellington wrote:

    I like your script.  Have you considered uploading it to the Cadsoft web

    site?

     

    didn't get around to uploading it yet.

    And likely won't do so in the near future as it's not in a shape I

    think warrants an upload.

     

    It's at least missing a eagle version check (as Ray already noticed),

    and I want to add a rearrange option (the picked-up parts may be

    spread widely).

     

    I'll see if I can find some tuits for that.

    --

     

    Lorenz

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • AnalogNotes
    AnalogNotes over 11 years ago in reply to autodeskguest

    Lorenz wrote:

    It's at least missing a eagle version check (as Ray already noticed),

    and I want to add a rearrange option (the picked-up parts may be

    spread widely).

     

    I'll see if I can find some tuits for that.

    Take a look at Jim Meech's aps.ulp or apg.ulp.  He uses a "scale" parameter, plus he has written the code to save and retrieve settings in an ini file.  Of course, my own habit is to write any settings file(s) into a subdirectory of each project (./scripts), so I'd suggest grabbing the directory test and creation code from one of my scripts as well...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago in reply to AnalogNotes

    Doug Wellington wrote:

    Lorenz wrote:

     

    It's at least missing a eagle version check (as Ray already

    noticed),

     

    and I want to add a rearrange option (the picked-up parts may be

    spread widely).

     

    I'll see if I can find some tuits for that.

     

    Take a look at Jim Meech's aps.ulp or apg.ulp.  He uses a "scale"

    parameter, plus he has written the code to save and retrieve settings in

    an ini file.  Of course, my own habit is to write any settings file(s)

    into a subdirectory of each project (./scripts), so I'd suggest grabbing

    the directory test and creation code from one of my scripts as well...

     

    I'll have a look, ... when/if I happen to find those round tuits ...

    --

     

    Lorenz

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • AnalogNotes
    AnalogNotes over 11 years ago in reply to autodeskguest

    Lorenz wrote:

    I'll have a look, ... when/if I happen to find those round tuits ...

     

    My grandfather actually had some little round disks with "tuit" printed on them.  LOL!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 11 years ago

    Hey Doug,

     

    I'm trying to run your arrange script, but it's giving me line errors that "Some objects extend outside the allowed board area", so I'm guessing the ULP is trying to place them outside of my outline.  Any way to remedy this?

     

    Also, is it possible to run arrange and distribute if you'd already placed and locked a few components?

     

    Thanks!
    Matt

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • skyflyrr
    skyflyrr over 11 years ago

    Nice ulp's Doug. Work well and very useful.

     

    Bob Moreno

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 11 years ago in reply to Former Member

    Matt Staniszewski wrote:

    I'm trying to run your arrange script, but it's giving me line errors

    that "Some objects extend outside the allowed board area", so I'm

    guessing the ULP is trying to place them outside of my outline.  Any

    way

    to remedy this?

     

    I'm guessing that you don't have the "full" version of EAGLE.  I'm not sure

    that my scripts will work with anything other than the professional

    version.  (For arrange.ulp, you might try changing the XQuadrant to +1 and

    shrink the rowIncrement and colIncrement values to see if that will work.

    For distribute.ulp, you'd need to change the YQuadrant to +1 and also

    shrink rowIncrement and colIncrement...)

     

    Also, is it possible to run arrange and distribute if you'd already

    placed and locked a few components?

     

    The arrange.ulp script will try to rearrange everything each time it is

    run, so only run it if you want to start your board over from the

    beginning.  The distribute.ulp script works on anything that you have

    selected, so as long as you don't select the placed and/or locked

    components, it should be fine...

    --

    Web access to CadSoft support forums at www.eaglecentral.ca.  Where the CadSoft EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube