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
Forum Have a question about CadSoft EAGLE?  Ask our Expert, Richard! (Archive)
  • 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 1129 replies
  • Subscribers 245 subscribers
  • Views 51187 views
  • Users 0 members are here
  • eagle
  • expert
  • richard_hammerl
  • cadsoft
Related

Have a question about CadSoft EAGLE?  Ask our Expert, Richard! (Archive)

nlarson
nlarson over 16 years ago

This thread is now locked - but you can still ask Richard by posting your questions here.  If you'd rather browse other member's questions you can read the CadSoft EAGLE Forums for past questions and answers. Enjoy!

 

Browse past Q&A help on anything technical relating to CadSoft EAGLE!


image

 

Richard Hammerl

Richard is an engineer with 16 years experience in EAGLE customer support and is waiting for your questions.

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

    Dear Richard,

    Again, sorry for my bad english image. I have a task to draw my schools symbol from vias, using ulp. I can calculate the coordinates for the vias in my ulp, but I can't draw any. In my another discussion you answered me, that is have to use a script. My question now is how can I autorun and than delete the script after the ulp was executed?

    Thanks for your help.

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

    Hello again,

     

    I am not sure what you exactly want to do....

    As far as I understand you want to write an ULP that places vias in your layout, correct?

    So you have to write an ULP that executes commands in the EAGLE layout editor. It is useful to let the ULP create a script (which contains a number of EAGLE commands executed subsequently) for your purose. Look into one of the ULPs in order to get out how this works, for example into change-via-by-stack.ulp:

     

    Here a short part of it where we create a script file that will be executed:


    board(B) {
        script = filesetext(B.name, ".scr");
        output(script, "wtD") {  // temporary file
          set_layer();
          B.signals(S) {
            S.vias(V) {
              if (V.start == via_start && V.end == via_end) {
                if (stack) printf("CHANGE VIA %s (%.4f %.4f);\n", new_stack, u2mm(V.x), u2mm(V.y) );
                else {
                  if (v_shape) printf("CHANGE SHAPE %s (%.4f %.4f);\n", v_shape, u2mm(V.x), u2mm(V.y) );
                  if (strupr(argv[3]) != "NO") {
                    if (v_drill) printf("CHANGE DRIL %.4f (%.4f %.4f);\n", v_drill, u2mm(V.x), u2mm(V.y) );
                    else         printf("CHANGE DRIL (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) );
                    if (v_diam)  printf("CHANGE DIAM %.4f (%.4f %.4f);\n", v_diam, u2mm(V.x), u2mm(V.y) );
                    else         printf("CHANGE DIAM (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) );
                  }
                }
              }
            }
          }
          printf("GRID LAST;\n");
          printf("DISPLAY NONE ");
          B.layers(L) if (L.visible) printf(" %d", L.number);
          printf(";\n");
        }
      }

    dlgDialog("test") {
      string text;
      int t = fileread(text, script);
      dlgTextEdit(text);
      dlgHBoxLayout {
        dlgPushButton("OK") dlgAccept();
        dlgPushButton("esc") { dlgReject(); exit(-1); }
        dlgStretch(1);
      }

    ........................

    ........................

    ........................

     

      exit("SCRIPT '" + script + "'\n");

     

    The output() statement creates the file, printf() writes the commands into the file. exit() executes the script file.

     

    Hopehis helps......

     

    Regards,

    Richard

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

    Hello again,

     

    I am not sure what you exactly want to do....

    As far as I understand you want to write an ULP that places vias in your layout, correct?

    So you have to write an ULP that executes commands in the EAGLE layout editor. It is useful to let the ULP create a script (which contains a number of EAGLE commands executed subsequently) for your purose. Look into one of the ULPs in order to get out how this works, for example into change-via-by-stack.ulp:

     

    Here a short part of it where we create a script file that will be executed:


    board(B) {
        script = filesetext(B.name, ".scr");
        output(script, "wtD") {  // temporary file
          set_layer();
          B.signals(S) {
            S.vias(V) {
              if (V.start == via_start && V.end == via_end) {
                if (stack) printf("CHANGE VIA %s (%.4f %.4f);\n", new_stack, u2mm(V.x), u2mm(V.y) );
                else {
                  if (v_shape) printf("CHANGE SHAPE %s (%.4f %.4f);\n", v_shape, u2mm(V.x), u2mm(V.y) );
                  if (strupr(argv[3]) != "NO") {
                    if (v_drill) printf("CHANGE DRIL %.4f (%.4f %.4f);\n", v_drill, u2mm(V.x), u2mm(V.y) );
                    else         printf("CHANGE DRIL (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) );
                    if (v_diam)  printf("CHANGE DIAM %.4f (%.4f %.4f);\n", v_diam, u2mm(V.x), u2mm(V.y) );
                    else         printf("CHANGE DIAM (%.4f %.4f);\n", u2mm(V.x), u2mm(V.y) );
                  }
                }
              }
            }
          }
          printf("GRID LAST;\n");
          printf("DISPLAY NONE ");
          B.layers(L) if (L.visible) printf(" %d", L.number);
          printf(";\n");
        }
      }

    dlgDialog("test") {
      string text;
      int t = fileread(text, script);
      dlgTextEdit(text);
      dlgHBoxLayout {
        dlgPushButton("OK") dlgAccept();
        dlgPushButton("esc") { dlgReject(); exit(-1); }
        dlgStretch(1);
      }

    ........................

    ........................

    ........................

     

      exit("SCRIPT '" + script + "'\n");

     

    The output() statement creates the file, printf() writes the commands into the file. exit() executes the script file.

     

    Hopehis helps......

     

    Regards,

    Richard

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