how to use command NAME to change a signal without mouse click?

how to use command NAME to change a signal without mouse click?

huayuliang
Enthusiast Enthusiast
5,194 Views
7 Replies
Message 1 of 8

how to use command NAME to change a signal without mouse click?

huayuliang
Enthusiast
Enthusiast

I'm writing a ULP now, I want change the signal name in my ULP. but how to use NAME command?

 

for example, a signal with name N$1 , I write down a command in command line in shematic editor: "NAME N$1 TN; " , it popup a message, tell me that N$1 not found... dose I can only use this command to change the device name without mouse click?

 

thanks.

Reply
Reply
0 Likes
5,195 Views
7 Replies
Replies (7)
Message 2 of 8

rachaelATWH4
Mentor
Mentor

@huayuliang wrote:

I'm writing a ULP now, I want change the signal name in my ULP. but how to use NAME command?

 

for example, a signal with name N$1 , I write down a command in command line in shematic editor: "NAME N$1 TN; " , it popup a message, tell me that N$1 not found... dose I can only use this command to change the device name without mouse click?

 

thanks.


You can tell it the "click" position when you create the command string in ulp by putting (x y) after the command.

 

e.g. NAME myNewName (x y);

 

I've done this in the nameNet.ulp I wrote in my EAGLE ULP utils library which for reference you can find here: https://www.element14.com/community/people/rachaelp/blog/2017/03/03/eagle-ulp-utilities-library

 

Best Regards,

 

Rachael

Reply
Reply
Message 3 of 8

huayuliang
Enthusiast
Enthusiast

Thanks your reply, I'm reading your ULP.

In fact, I'm try to writing a ULP to convert PCB to schematic.

this "idear" is very simple, once I have brd file, but need provide sch file, just place the device in schematic and place short net wire on pin, use the net name in brd replace net name in sch according same pin of device.

I have test this manually by using ERC..

 

Another way is modify the sch file, since EAGLE use XML file, all becomes  posible, But my poor language skill stop me do tis.... I need learn```

Reply
Reply
0 Likes
Message 4 of 8

huayuliang
Enthusiast
Enthusiast

your "nameNet.ulp" is very useful for me! 

 

and I do a little modify for myself, add the part name as prefix to avoid net name conflict:

 

   if (schematic) {
      schematic(S) {
         S.sheets(SH) {
            SH.instances(IN) {
	       string part_name = "";
	       device_name = IN.part.name;	
               IN.gate.symbol.pins(P) {
                  if (ingroup(IN)) {
                     SH.nets(N) {
                        if (N.name == P.net) {
                           if (P.direction != PIN_DIRECTION_PWR) {
                              N.segments(SEG) {
                                 SEG.wires(W) {
                                    string tmp;
                                    sprintf(tmp, "NAME %s_%s (%f %f);", part_name, P.name, u2inch(W.x1), u2inch(W.y1));
                                    cmd += tmp;
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }
Reply
Reply
Message 5 of 8

rachaelATWH4
Mentor
Mentor

@huayuliang wrote:

your "nameNet.ulp" is very useful for me! 

 

and I do a little modify for myself, add the part name as prefix to avoid net name conflict:

 

   if (schematic) {
      schematic(S) {
         S.sheets(SH) {
            SH.instances(IN) {
	       string part_name = "";
	       device_name = IN.part.name;	
               IN.gate.symbol.pins(P) {
                  if (ingroup(IN)) {
                     SH.nets(N) {
                        if (N.name == P.net) {
                           if (P.direction != PIN_DIRECTION_PWR) {
                              N.segments(SEG) {
                                 SEG.wires(W) {
                                    string tmp;
                                    sprintf(tmp, "NAME %s_%s (%f %f);", part_name, P.name, u2inch(W.x1), u2inch(W.y1));
                                    cmd += tmp;
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
   }

I'm glad you found it useful!

 

The change you made resolves one of the items I listed in my Known Limitations section on the Element14 blog post. Have you looked through those as the one regarding supply rails is particularly important?

 

There's a whole bunch of additional tidying up I need to do on this library and more issues to resolve when I have some time to go back and sort them out.

 

Best Regards,

 

Rachael

Reply
Reply
0 Likes
Message 6 of 8

huayuliang
Enthusiast
Enthusiast

Yes, you are right. the supply rail should not be change, many manufacturers has its own naming rule. for example, there is a pin named "VSS", but we need it connect to "GND", if this ULP change all, it will be change to "VSS", and we must change it back to "GND". 

 

about adding prefix, if we don't need add prefix for the operation, how do you think? use another ULP? or use a dialog box for user to select ?

if someone like suffix ??? LOL...

Reply
Reply
0 Likes
Message 7 of 8

rachaelATWH4
Mentor
Mentor

@huayuliang wrote:

Yes, you are right. the supply rail should not be change, many manufacturers has its own naming rule. for example, there is a pin named "VSS", but we need it connect to "GND", if this ULP change all, it will be change to "VSS", and we must change it back to "GND". 

 

about adding prefix, if we don't need add prefix for the operation, how do you think? use another ULP? or use a dialog box for user to select ?

if someone like suffix ??? LOL...


I've put some of my ideas for how it should work in the blog post, I'm planning on having additional attributes added to parts which will help guide the net naming. There will be UI elements which will be added which will help make this easy to do and guide everything, these will all be included within the one ULP. If you've got ideas which are different or in addition to how I have proposed it should work let me know.

 

Best Regards,

 

Rachael

Reply
Reply
Message 8 of 8

huayuliang
Enthusiast
Enthusiast

It's good.

I think it's best to add install and remove dialog intereface for user.  also include me , I don't like to enter  too more in command line.

 

Reply
Reply
0 Likes