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) Rename vias 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
  • State Not Answered
  • Replies 7 replies
  • Subscribers 189 subscribers
  • Views 1337 views
  • Users 0 members are here
Related

Rename vias in ULP

e14 Contributor
e14 Contributor over 14 years ago

Hi

 

is it possible within a ULP to rename vias?

I have the following situation, I have an RF board with polygons on 3 layers and several hundred vias linking these together.  The polygons all have the same name but the vias all have  diffrent names, i do not like the prospect of going throuch the NAME gui close on a thousand times.

I have tried NAME S$11 g in the command line (where S$11 is the name of a via as shown by the name dialogue) - this returns "unknown element: S$11 "

  • Sign in to reply
  • Cancel
Parents
  • e14 Contributor
    0 e14 Contributor over 14 years ago

    On 10/03/2011 08:10 AM, Stephen Cole wrote:

    Hi

     

    is it possible within a ULP to rename vias?

    I have the following situation, I have an RF board with polygons on 3 layers and several hundred vias linking these together.  The polygons all have the same name but the vias all have  diffrent names, i do not like the prospect of going throuch the NAME gui close on a thousand times.

    I have tried NAME S$11 g in the command line (where S$11 is the name of a via as shown by the name dialogue) - this returns "unknown element: S$11 "

     

     

    Have you tried grouping the vias and do a change name on the group?

     

    Unfortunately you can not identify a via by it's name, since the name

    reflects the name of its host net.

     

    But, vias can be identified by coordinates.

     

    You can't change anything in a ULP since they are read-only, but a ULP

    can create a script that can be executed on exit from the ULP.  The

    script needs to be of the form:

     

        name newNet (x y);

     

    where "newNet" is the name of the polygon to which the via should

    connect, and "x" and "y" are the coordinates of the via.  In the ULP you

    can:

     

    The next challenge is to spin through all the signals looking for vias

    that need their name changed.  You can use a structure similar to:

     

    string cmdBuf;

    string exitScript;

    board(B) {

     

            // Set the grid to mils

            exitScript += "GRID mil;\n";

     

            // Spin through the board's signals

            B.signals(SIG) {

     

                // filter out signals that we do NOT want to examine

                if (strcmp(SIG.name, "unwanted"))

                    continue;

     

                // Spin through each via on this signal.

                SIG.vias(VIA) {

                   // do other tests to eliminate vias that don't need

                   // changing

     

                ...

                   // collect vias to change

                   sprintf(cmdBuf, "name %s (%f %f);\n", "newNet",

                u2mil(VIA.x), u2mil(VIA.y));

                   exitScript += cmdBuf;

                } // End of vias loop

     

            } // end of signals loop

     

            // Set the grid back to what it was.

            exitScript += "GRID last;\n";

     

    }  // end of board

     

    // Execute the script we just built.

    exit(exitScript);

     

     

    Remember that the X and Y coordinates of the via are expressed in native

    units, and need to be converted to whatever your grid unit is set to

    before appending the script command to the exit string.  See the

    u2mil(), u2mm(), and u2inch() functions on page 92 of the ULP manual,

    ulp5110_en.pdf.

     

    Hope this helps.

     

    Enjoy,

        - Chuck

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • e14 Contributor
    0 e14 Contributor over 14 years ago

    On 10/03/2011 08:10 AM, Stephen Cole wrote:

    Hi

     

    is it possible within a ULP to rename vias?

    I have the following situation, I have an RF board with polygons on 3 layers and several hundred vias linking these together.  The polygons all have the same name but the vias all have  diffrent names, i do not like the prospect of going throuch the NAME gui close on a thousand times.

    I have tried NAME S$11 g in the command line (where S$11 is the name of a via as shown by the name dialogue) - this returns "unknown element: S$11 "

     

     

    Have you tried grouping the vias and do a change name on the group?

     

    Unfortunately you can not identify a via by it's name, since the name

    reflects the name of its host net.

     

    But, vias can be identified by coordinates.

     

    You can't change anything in a ULP since they are read-only, but a ULP

    can create a script that can be executed on exit from the ULP.  The

    script needs to be of the form:

     

        name newNet (x y);

     

    where "newNet" is the name of the polygon to which the via should

    connect, and "x" and "y" are the coordinates of the via.  In the ULP you

    can:

     

    The next challenge is to spin through all the signals looking for vias

    that need their name changed.  You can use a structure similar to:

     

    string cmdBuf;

    string exitScript;

    board(B) {

     

            // Set the grid to mils

            exitScript += "GRID mil;\n";

     

            // Spin through the board's signals

            B.signals(SIG) {

     

                // filter out signals that we do NOT want to examine

                if (strcmp(SIG.name, "unwanted"))

                    continue;

     

                // Spin through each via on this signal.

                SIG.vias(VIA) {

                   // do other tests to eliminate vias that don't need

                   // changing

     

                ...

                   // collect vias to change

                   sprintf(cmdBuf, "name %s (%f %f);\n", "newNet",

                u2mil(VIA.x), u2mil(VIA.y));

                   exitScript += cmdBuf;

                } // End of vias loop

     

            } // end of signals loop

     

            // Set the grid back to what it was.

            exitScript += "GRID last;\n";

     

    }  // end of board

     

    // Execute the script we just built.

    exit(exitScript);

     

     

    Remember that the X and Y coordinates of the via are expressed in native

    units, and need to be converted to whatever your grid unit is set to

    before appending the script command to the exit string.  See the

    u2mil(), u2mm(), and u2inch() functions on page 92 of the ULP manual,

    ulp5110_en.pdf.

     

    Hope this helps.

     

    Enjoy,

        - Chuck

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • e14 Contributor
    0 e14 Contributor over 14 years ago in reply to e14 Contributor

    On 10/03/2011 09:00 AM, Chuck Huber wrote:

    On 10/03/2011 08:10 AM, Stephen Cole wrote:

    >> Hi

    >>

    >> is it possible within a ULP to rename vias?

    >> I have the following situation, I have an RF board with polygons on 3 layers and several hundred vias linking these together.  The polygons all have the same name but the vias all have  diffrent names, i do not like the prospect of going throuch the NAME gui close on a thousand times.

    >> I have tried NAME S$11 g in the command line (where S$11 is the name of a via as shown by the name dialogue) - this returns "unknown element: S$11 "

    >>

     

    Have you tried grouping the vias and do a change name on the group?

     

    Unfortunately you can not identify a via by it's name, since the name

    reflects the name of its host net.

     

    But, vias can be identified by coordinates.

     

    You can't change anything in a ULP since they are read-only, but a ULP

    can create a script that can be executed on exit from the ULP.  The

    script needs to be of the form:

     

        name newNet (x y);

     

    where "newNet" is the name of the polygon to which the via should

    connect, and "x" and "y" are the coordinates of the via.  In the ULP you

    can:

     

    The next challenge is to spin through all the signals looking for vias

    that need their name changed.  You can use a structure similar to:

     

    string cmdBuf;

    string exitScript;

    board(B) {

     

            // Set the grid to mils

            exitScript += "GRID mil;\n";

     

    I might add that you can skip the units conversion if you just use the

    finest grid.

     

              exitScript += "GRID FINEST;\n";

     

     

            // Spin through the board's signals

            B.signals(SIG) {

     

                // filter out signals that we do NOT want to examine

                if (strcmp(SIG.name, "unwanted"))

                    continue;

     

                // Spin through each via on this signal.

                SIG.vias(VIA) {

                   // do other tests to eliminate vias that don't need

                   // changing

     

                ...

                   // collect vias to change

                   sprintf(cmdBuf, "name %s (%f %f);\n", "newNet",

                         VIA.x, VIA.y);

     

                   exitScript += cmdBuf;

                } // End of vias loop

     

            } // end of signals loop

     

            // Set the grid back to what it was.

            exitScript += "GRID last;\n";

     

    }  // end of board

     

    // Execute the script we just built.

    exit(exitScript);

     

    Enjoy,

        - Chuck

     

     

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

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube