element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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) How to find current shee t in ULP?
  • 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 5 replies
  • Subscribers 180 subscribers
  • Views 753 views
  • Users 0 members are here
Related

How to find current shee t in ULP?

autodeskguest
autodeskguest over 9 years ago

I finally decided to write ULPs to go backwards and forwards one sheet in

the schematic editor, so that I could tie these to shortcut keys.

 

I looked at the ULP help again (version 7.7), and it appears the only

system state accessible to a ULP are the top level schematic, board, and

library structures, and then anything contained in them.  I looked over the

schematic structure again, but there appears to be no current state in

there, like the current schematic sheet.

 

How do I determine the current schematic sheet from a ULP?

--

http://www.eaglecentral.ca :: The original and best browser access to CadSoft EAGLE support forums.  Supported by EAGLE licenses purchased through us :: http://www.eaglelicenses.com

 

  • Sign in to reply
  • Cancel
Parents
  • autodeskguest
    autodeskguest over 9 years ago

    Am 02.12.2016 um 13:54 schrieb Olin Lathrop:

    How do I determine the current schematic sheet from a ULP?

     

    if(sheet) sheet(S)

    {

        string txt;

        sprintf(txt, "Current sheet: %d", S.number);

        dlgMessageBox(txt);

    }

     

    However, the ULP you're trying to write already ship with EAGLE, look

    for "editnext-sheet.ulp" and "editprev-sheet.ulp".

     

    Rene

     

     

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

    rk wrote on Fri, 02 December 2016 08:01

    However, the ULP you're trying to write already ship with EAGLE, look

    for "editnext-sheet.ulp" and "editprev-sheet.ulp".

     

     

    Thanks.  I looked at one of those as a example.  The trick is the "sheet"

    built-in statement.

     

    If you look at the help page USER LANGUAGE > OBJECT TYPES, it implies the

    only data structure-opening statements are LIBRARY, SCHEMATIC, and BOARD.

    I did find SHEET listed as one of the built-in statements later on.

     

    Eagle's help system strikes once again.  It is good for reference if you

    know what to look up, but not so good at helping you find things that you

    don't know about yet.  Argh.  I really hope AutoDesk does something about

    this.  Personally, I'd much rather they spend time on making the

    documentation usable for the introductory purpose too, not just for

    reference, than messing with the UI.

     

    I really do try to RTFM, but the M has to do its part by making the

    information findable for other than looking up details within a known

    context.

    --

    http://www.eaglecentral.ca :: The original and best browser access to CadSoft EAGLE support forums.  Supported by EAGLE licenses purchased through us :: http://www.eaglelicenses.com

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • autodeskguest
    autodeskguest over 9 years ago in reply to autodeskguest

    rk wrote on Fri, 02 December 2016 08:01

    However, the ULP you're trying to write already ship with EAGLE, look

    for "editnext-sheet.ulp" and "editprev-sheet.ulp".

     

     

    Thanks.  I looked at one of those as a example.  The trick is the "sheet"

    built-in statement.

     

    If you look at the help page USER LANGUAGE > OBJECT TYPES, it implies the

    only data structure-opening statements are LIBRARY, SCHEMATIC, and BOARD.

    I did find SHEET listed as one of the built-in statements later on.

     

    Eagle's help system strikes once again.  It is good for reference if you

    know what to look up, but not so good at helping you find things that you

    don't know about yet.  Argh.  I really hope AutoDesk does something about

    this.  Personally, I'd much rather they spend time on making the

    documentation usable for the introductory purpose too, not just for

    reference, than messing with the UI.

     

    I really do try to RTFM, but the M has to do its part by making the

    information findable for other than looking up details within a known

    context.

    --

    http://www.eaglecentral.ca :: The original and best browser access to CadSoft EAGLE support forums.  Supported by EAGLE licenses purchased through us :: http://www.eaglelicenses.com

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • autodeskguest
    autodeskguest over 9 years ago in reply to autodeskguest

    On 3/12/2016 3:41 a.m., Olin Lathrop wrote:

    rk wrote on Fri, 02 December 2016 08:01

    However, the ULP you're trying to write already ship with EAGLE, look

    for "editnext-sheet.ulp" and "editprev-sheet.ulp".

     

    Thanks.  I looked at one of those as a example.  The trick is the "sheet"

    built-in statement.

     

    If you look at the help page USER LANGUAGE > OBJECT TYPES, it implies the

    only data structure-opening statements are LIBRARY, SCHEMATIC, and BOARD.

    I did find SHEET listed as one of the built-in statements later on.

     

    Eagle's help system strikes once again.  It is good for reference if you

    know what to look up, but not so good at helping you find things that you

    don't know about yet.  Argh.  I really hope AutoDesk does something about

    this.  Personally, I'd much rather they spend time on making the

    documentation usable for the introductory purpose too, not just for

    reference, than messing with the UI.

     

    I really do try to RTFM, but the M has to do its part by making the

    information findable for other than looking up details within a known

    context.

     

     

    I find the HELP very good when writing ULPs.

    The key is for one to choose the correct keyword to search on.

    Don't expect it to work well with "How do I do....?" It's not that style

    of tool.

     

    Identify the one word that should be within the explanation.

    Sometimes you need to have a second word choice to approach from a

    second angle.

    Sometimes you don't know how the functionality is described so knowing

    the best keyword is harder to know but that shows the need to have read

    the manual at least once.

     

    So the sheet example is a good example as you know you subject is sheets.

     

    I always remove make the search singular so search for sheet and not sheets

     

    If you key the word sheet, all pages containing the keyword are returned

    in bold.

     

    The area of interest is to do with 'User Language' so click on that and

    expand the tree , looking for bold type.

     

    There can be a lot of reading under 'Object Types' so my approach is

    always to get rid of the remaining scraps first. As with Olins's case,

    that is where the seed of the answer lay. This often the case as many

    powerful commands are outliers from the commands within the Object types.

     

    At other times I have used multiple words that I feel would be together

    in the explanation. 'sheet context' goes exactly to Olin's answer as its

    the only place with the word combination, but once you get there it's

    not obvious that it would be the answer to the question. In this case

    you need to recall that once the current sheet context is instantiated

    you will be able to read its number.

     

    So, while many of the help explanations have examples that clarify and

    educate, there are others that need another paragraph to enlighten the

    reader about what they have just read so they reach that " Oh! I see"

    moment.

     

    My view regarding documentation is one of education and to focus

    elsewhere, away from the app with a repository of mini-tutorials that

    explain the product and address questions, no matter where you are in

    the Eagle leaning process. Possibly along the lines of the W3schools

    site. (http://www.w3schools.com/)

     

    The goal should be for the forum to go very quiet and only solutions not

    available from this source to be raised.

     

    Warren

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

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

    warrenbrayshaw wrote on Fri, 02 December 2016 14:29

    I find the HELP very good when writing ULPs.

     

     

    Yes, the information is generally there.  Sometimes searches work, as you

    show.  Other times, you don't know what to ask, or a likely keyword is so

    generic that it get so many hits to be useless.

     

    The real problem is not the documentation that is there.  It serves the

    reference purpose when you know what you want to do, just need to look up

    some details.

     

    The problem is lack of any introductory or overview documentation.  The 10

    page Introduction to ULPs and How to Use Them is missing.  That goes for

    every other general Eagle capability.  This is not the same as reading the

    existing help.  Diving into details without the larger context is no way to

    learn, and all the details are clutter that detract from learning the

    higher level concepts.  Once you have those concepts, you are ready to ask

    specific question about details of commands.  The existing help does work

    for that, but not to get you to that level.

     

    In any case, once I found the schematic built-in command, writing the ULP

    was easy.  I know these already exist, but as a exercise to learn and

    verify that I understood things correctly, I wrote my own.  I also comment

    my ULPs, unlike most other people apparently.  Here is my ULP to advance to

    the next schematic sheet:

     

     

    #usage "

    h1. Go to next schematic sheet

    \n"

     

    int oldsheet;                     //1-N number of the current sheet

    int lastsheet;                    //number of last existing schematic

    sheet

    string cmd;                       //command to execute on exit

     

    //

    //   Start of main program.

    //

      sheet (sh) {                    //open the current sheet

        oldsheet = sh.number;         //get the 1-N number of the current

    sheet

        }

     

      lastsheet = 0;                  //init last sheet number to invalid

      schematic (sch) {               //open the whole schematic

        sch.sheets(sh) {              //loop thru the sheets of the schematic

          lastsheet = max(lastsheet, sh.number); //save largest sheet number

          }

        }

     

      if (oldsheet < lastsheet)

        {                             //there is a sheet to advance to

          sprintf (cmd, "edit .s%d;\n", oldsheet + 1);

          exit (cmd);

          }

        else {                        //already at last sheet

          exit (EXIT_SUCCESS);        //do nothing

          }

     

     

    I tied these ULPs to hot keys in the schematic section of the eagle.scr

    file, and it works great.

     

    One disappointment was that actions can only be assigned to function,

    letter, numbers, and backspace keys.  I really wanted to assign these ULPs

    to the left and right arrows.  Those keys aren't otherwise used in Eagle,

    and that would make going thru pages forwards and backwards just like a PDF

    file with Acrobat Reader.

     

    Is there really a good reason Eagle couldn't allow assignment to the arrow

    keys and other special keys?  If not, that would be a nice feature to add.

    I suppose that should be the topic of another thread.

    --

    http://www.eaglecentral.ca :: The original and best browser access to CadSoft EAGLE support forums.  Supported by EAGLE licenses purchased through us :: http://www.eaglelicenses.com

     

    • 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 © 2026 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