EAGLE Central Forums
Where the EAGLE community meets. Sponsored by Stratford Digital.

Home » CadSoft Support Forums » eagle.support.eng » Eagle Command Line Name for Net
Eagle Command Line Name for Net [message #169435] Fri, 17 February 2017 13:04 Go to next message
Romain Delamea
Messages: 1
Registered: February 2017
Junior Member
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 :(

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

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/216060
Re: Eagle Command Line Name for Net [message #169436 is a reply to message #169435] Fri, 17 February 2017 15:19 Go to previous messageGo to next message
rachaelp
Messages: 532
Registered: March 2015
Location: UK
Senior Member
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:

{code:modifiedtitle=true|class=_jivemacro_uid_148734453834261 jive_macro_code jive_text_macro|data-renderedposition=134_8_1576_400|jivemacro_uid=_1487344 53834261}// 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 (%f %f);", argv[2],u2inch(W.x1),u2inch(W.y1));
                     cmd += tmp;
                  }
               }
            }
         }
      }
   }
}

cmd += "SET CONFIRM OFF;";
exit(cmd);


{code}
now if you issue the following command:

{code:class=jive_macro_code _jivemacro_uid_14873447629098535 jive_text_macro|data-renderedposition=576_8_1576_16|jivemacro_uid=_14873447 629098535}run nameNet OLD_NAME NEW_NAME{code}

You should find that you name 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

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/216074
Re: Eagle Command Line Name for Net [message #169490 is a reply to message #169436] Mon, 20 February 2017 06:43 Go to previous messageGo to next message
Lorenz
Messages: 640
Registered: December 2006
Senior Member
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
Re: Eagle Command Line Name for Net [message #169492 is a reply to message #169490] Mon, 20 February 2017 07:28 Go to previous message
rachaelp
Messages: 532
Registered: March 2015
Location: UK
Senior Member
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....
Previous Topic: ARDUINO MEGA2560 NOT AUTOROUTING ON EAGLE
Next Topic: Eagle PCB exporting image default as Negative
Goto Forum:
  


Current Time: Fri Apr 28 19:43:06 GMT 2017