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
  • 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 Chat (English) ULP Detection of open project
  • 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 4 replies
  • Subscribers 178 subscribers
  • Views 435 views
  • Users 0 members are here
Related

ULP Detection of open project

Former Member
Former Member over 15 years ago

Does anyone know of a ULP technique for detecting if there is an open

project?

 

Scenarios to give this question some context:

1) You can open a board design (board editor) from the open project folder.

2) While a project is open you can open a board design from anywhere other

than the open project folder.

3) You can open a board design from anywhere when there is no project open.

 

When the board editor is opened, Eagle looks for an eagle.scr. First in the

folder of the open project, if there is one open, and then in the Script

folder/folders you set up in Options/Directories.

 

I wish to write a ULP that manipulates eagle.scr and cater for most of the

ways people have set up their environments. While most people likely  have a

single eagle.scr in the main script folder there are other possibilities:

1) An eagle.scr in the script folder

2) An eagle.scr in each project folder

3) An eagle.scr in each project folder and one in the script folder

4) No eagle.scr at all.

 

So I need to target the correct eagle.scr. and the correct one, when there

are multiple, depends on the 'Open Project' status.

Right now I'm finding them all and the user chooses the one they desire but

a little more automation would be nice as I can then flag which one created

the view they currently have.

 

Any help would be appreciated

Warren

 

 

 

 

 

 

 

 

 

 

 

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 15 years ago

     

    "Warren Brayshaw" <warrenbrayshaw@paradise.net.nz> wrote in message

    news:i4s4ob$adn$1@cheetah.cadsoft.de...

    Does anyone know of a ULP technique for detecting if there is an open

    project?

     

    Have you tried the 'project' prefix of project.board() {}? Search for

    "prefix project" in the help window to see what it can do. I am not sure if

    you can read this prefix alone. Try it.

     

     

     

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

     

    "Warren Brayshaw" <warrenbrayshaw@paradise.net.nz> wrote in message

    news:i4s4ob$adn$1@cheetah.cadsoft.de...

    Does anyone know of a ULP technique for detecting if there is an open

    project?

     

    Have you tried the 'project' prefix of project.board() {}? Search for

    "prefix project" in the help window to see what it can do. I am not sure if

    you can read this prefix alone. Try it.

     

     

     

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

     

    "Morten Leikvoll" wrote>

    Have you tried the 'project' prefix of project.board() {}? Search for

    "prefix project" in the help window to see what it can do. I am not sure

    if

    you can read this prefix alone. Try it.

    >

     

     

    Thanks for the suggestion. I could not solicit any responses from guesses of

    the likely syntax/keywords  for "project ." .

    The most likely return would be the path for the open project and null if

    there is no open project. That would have been good.

     

    Warren

     

     

     

     

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

    "Warren Brayshaw" <warrenbrayshaw@paradise.net.nz> wrote in message

    news:i51d5t$uvl$1@cheetah.cadsoft.de...

    Thanks for the suggestion. I could not solicit any responses from guesses

    of

    the likely syntax/keywords  for "project ." .

    The most likely return would be the path for the open project and null if

    there is no open project. That would have been good.

     

    Using a hint from "consistancy check" topic in suggest forum dated back

    8.sep 2009,  try this:

     

    if (project.board && project.schematic)

    {

         //Full brd+sch project is open

    }

    else

    {

        if(project.board) //board is open as a project?

        else if(board) //board file is open, but not in a project?

        if(project.schematics) //schematics is open as a project?

        else if(schematics) //schematic is open, but not in a project?

    }

     

    Im not sure if this will work, but something tells me it might.

     

    I am not sure what the default directory is for the different results, but I

    would think its the project folder if its a project, and somewhere else if a

    project isn't opened.

     

    You may want to just check:

    if (project.board || project.schematic) //its in project folder

    else //its somewhere else?

     

     

     

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

     

    "Morten Leikvoll"  wrote>

    Using a hint from "consistancy check" topic in suggest forum dated back

    8.sep 2009,  try this:

    >

    if (project.board && project.schematic)

    {

         //Full brd+sch project is open

    }

    else

    {

        if(project.board) //board is open as a project?

        else if(board) //board file is open, but not in a project?

        if(project.schematics) //schematics is open as a project?

        else if(schematics) //schematic is open, but not in a project?

    }

    >

    Im not sure if this will work, but something tells me it might.

    >

    I am not sure what the default directory is for the different results, but

    I

    would think its the project folder if its a project, and somewhere else if

    a

    project isn't opened.

    >

    You may want to just check:

    if (project.board || project.schematic) //its in project folder

    else //its somewhere else?

    >

     

    Thanks Morten but alas no luck using the project prefix.

     

    project.board && project.schematic

    As per the "consistency check" topic  this can be used to test for

    consistency (if both board and schematic are displayed.)

    If there is inconsistency between the open board and open schematic then it

    evaluates false.

    If the project is open and the board/schem  are consistent but only one of

    them open it evaluates false.

     

    project.board

    This is less useful . It returns 'true' for any open board.  I does not

    matter if there is a project open or not. Nor if the board came from a

    project folder or elsewhere.

    So it appears that this is not the route to detecting if there is an open

    project

     

    Default folders: Better luck here,

    I experimented.

    A board opened from anywhere with no open project:----


    Default file

    placed in Eagle directory

    A board opened from the open project:----


    Default file placed is in

    Open Project folder

    A board outside the open project:----


    Default file placed is in Open

    Project folder

     

    So I can detect an Open Project and which project it is by creating a file

    and seeing where it ends up.

    Additionally, going back to my original post, I can detect which eagle.scr

    has been used as it behaves similarly.

     

    A board opened from anywhere with no open project:----


    Uses eagle.scr

    from Script directory

    A board opened from anywhere when there is an open project:----


    Uses

    eagle.scr from the Open Project folder if there is an eagle.scr there, if

    not then uses eagle.scr from Script directory )

    A board automatically opened when re-opening a project (remembered as open

    when project was last closed). All eagle.scr ignored and board file

    re-instated as it was.

     

    Detecting where a fake file ends up is a bunch of code that could be avoided

    if there was a ULP command "project.name" returning the open project path or

    null if there is no open project.

    Eagle knows about the Open project path so it should not be difficult to

    expose it in the UL. I'll request it.

     

    Warren

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    • 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