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 Support (English) Eagle Command Line Name for Net
  • 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
  • State Not Answered
  • Replies 5 replies
  • Subscribers 179 subscribers
  • Views 1261 views
  • Users 0 members are here
  • eagle
  • name
  • command
  • net
Related

Eagle Command Line Name for Net

romaindelamea
romaindelamea over 8 years ago

Hi !

 

I'm looking for a command line to name a Net.

 

To name a part, I write "NAME OLD_NAME NEW_NAME (for example : NAME IC1 UC, IC1 is the name automatically given and UC the new name I want.

 

But this command does't work with NET. When I write NAME N$1 SPI_CS to name the NET N$1 "SPI_CS" I get an error : Eagle doesn't know the part N$1 !

 

I've tried with command "NAME 'NET: N$1 SPI_CS" ('NET: N$1 is wrote on the bottom of the eagle windows) but it doesn't work too image

 

Does anybody has an idea of what command use ?

 

Tank's for answer and have a good day !

 

Romain.

 

PS : Sorry for my bad English, I'm a french user image

  • Sign in to reply
  • Cancel
Parents
  • rachaelp
    0 rachaelp over 8 years ago

    Hi Romain,

     

    Yes you can't use the NET command in that way although you can work around it with a simple ULP.

     

    Copy the following into a file called nameNet.ulp and put it into your ULP folder:

     

    // Define variables
    string cmd="SET CONFIRM YES; ";
    
    if (schematic) {
       schematic(S) {
          S.sheets(SH) {
             SH.nets(N) {
                string tmp;
                if (N.name == argv[1]) {
                   N.segments(SEG) {
                      SEG.wires(W) {
                         sprintf(tmp, "NAME %s (%fin %fin);", argv[2],u2inch(W.x1),u2inch(W.y1));
                         cmd += tmp;
                      }
                   }
                }
             }
          }
       }
    }
    
    cmd += "SET CONFIRM OFF;";
    exit(cmd);

     

    now issue the following command:

     

    run nameNet OLD_NAME NEW_NAME

     

    You should find that your net gets renamed throughout your schematic.

     

    Please note: I have NOT fully tested this and it is to be used completely at your own risk.

     

    Best Regards,

     

    Rachael

     

    EDIT: Updated as per comments from Lorenz below.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • autodeskguest
    0 autodeskguest over 8 years ago in reply to rachaelp

    rachaelp wrote:

    Yes you can't use the NET command in that way although you can work around it with a simple ULP.

                         sprintf(tmp, "NAME %s (%f %f);", argv[2],u2inch(W.x1),u2inch(W.y1));

     

    one small modification here. You either need to make sure your grid

    setting matches the coordinate conversion function, or use explicit

    units in your coordinate formating.

     

    Something linke:

     

    :  sprintf(tmp, "NAME %s (%fin %fin);", argv[2],u2inch(W.x1),u2inch(W.y1));

     

    or

     

    :  sprintf(tmp, "NAME %s (%fmic %fmic);", argv[2],u2mic(W.x1),u2mic(W.y1));

    --

     

    Lorenz

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • rachaelp
    0 rachaelp over 8 years ago in reply to autodeskguest

    Hi Lorenz,

     

    Yes that's a good point! I didn't bother checking as I only ever use inches

    in schematics but yes, using the explicit units in the coordinate

    formatting is the correct thing to do. Thanks for pointing this out.

     

    Best Regards,

     

    Rachael

     

    P.S. Sorry for the messed up code presentation on NNTP / EAGLE Central, I

    posted my original reply on Element14 and it seems code sections don't come

    over to these places well at all....

    --

    EAGLE support forums at http://www.eaglecentral.ca :: Where the EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • rachaelp
    0 rachaelp over 8 years ago in reply to autodeskguest

    Hi Lorenz,

     

    Yes that's a good point! I didn't bother checking as I only ever use inches

    in schematics but yes, using the explicit units in the coordinate

    formatting is the correct thing to do. Thanks for pointing this out.

     

    Best Regards,

     

    Rachael

     

    P.S. Sorry for the messed up code presentation on NNTP / EAGLE Central, I

    posted my original reply on Element14 and it seems code sections don't come

    over to these places well at all....

    --

    EAGLE support forums at http://www.eaglecentral.ca :: Where the EAGLE community meets.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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