<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to write ULP script to replace all &amp;gt;NAME and &amp;gt;VALUE with my define in EAGLE Forum</title>
    <link>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8632636#M17869</link>
    <description>I haven't heard of anyone creating a ulp to add custom fonts. If you get this working I would be very interested in trying it out.&lt;BR /&gt;&lt;BR /&gt;If you look at many of the ULPs included with Eagle you will notice that the output command is built up into a string. That string is what the final ulp will exit and run. So in your code you can add, subtract, multiply, and whatever else you need to do to the coordinates before running the command. I would suggest looking at the help file for sprintf and looking through some stock ulps. Some have different coding styles depending on how old they are.</description>
    <pubDate>Sun, 03 Mar 2019 07:02:17 GMT</pubDate>
    <dc:creator>C.Nicks</dc:creator>
    <dc:date>2019-03-03T07:02:17Z</dc:date>
    <item>
      <title>How to write ULP script to replace all &gt;NAME and &gt;VALUE with my defined font</title>
      <link>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8629995#M17866</link>
      <description>&lt;P&gt;I have finished one project and would like to add my custom font from PCB DOS because it looks more professional and it is more nice that EAGLE have build in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i need example script that takes in Board Editor names and values of components and replace it with my defined font or wires in my ulp script that i draw manually or to use external&amp;nbsp;.ttf file that generates then font.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, i have two resistors in Board Editor, when i run font_change.ulp script i need to get R1 and R2 (name of components), and then search in ulp script that names and put from script that names to resistor position like it original was but with different font.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please give me example ulp script that do that? I will then update font style with wires in that script manually after that is done correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to get all name values of components and this is working:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;board(B) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; B.elements(E) dlgMessageBox(E.name, "Ok");&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i got two message box with values R1 and R2. Now i could not know how to add case with custom defined font in that ulp file and replace R1 and R2 on resistor name with my custom font?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i need like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;switch(E.name):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;case "R1":&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LINE 10, 20, 16, 23, 0.254&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LINE 12, 24, 12, 21, 0.254&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;case "R2":&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LINE 11, 26, 17, 22, 0.254&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LINE 13, 25, 13, 29, 0.254&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then replace R1 on resistor name with above lines.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 11:59:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8629995#M17866</guid>
      <dc:creator>ronovar</dc:creator>
      <dc:date>2019-03-01T11:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to write ULP script to replace all &gt;NAME and &gt;VALUE with my define</title>
      <link>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8630548#M17867</link>
      <description>&lt;P&gt;I don't think custom fonts are even possible in eagle. I think your only options are Proportional, fixed, Vector new and Vector Old.&lt;BR /&gt;&lt;BR /&gt;Have you tried the old and new vector fonts? I quite like the new ones and they look great on a board.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 16:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8630548#M17867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T16:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to write ULP script to replace all &gt;NAME and &gt;VALUE with my define</title>
      <link>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8631065#M17868</link>
      <description>&lt;P&gt;I made a little progress, i write this little script that run in Board Editor (ULP) and create R with lines (i convert from DOS program to lines and create nice R looking font that i will use on layer 55 tfName).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;string cmd = "";&lt;BR /&gt;board(B) {&lt;BR /&gt;B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 (-0.950 0.635) (-0.950 -0.635); LINE 25 0.254 (-0.950 0.635) (-0.320 0.635); LINE 25 0.254 (-0.320 0.635) (-0.090 0.425); LINE 25 0.254 (-0.090 0.425) (-0.090 0.226); LINE 25 0.254 (-0.090 0.226) (-0.320 -0.005); LINE 25 0.254 (-0.320 -0.005) (-0.950 -0.005); LINE 25 0.254 (-0.720 -0.005) (-0.090 -0.635);"; exit(cmd); dlgMessageBox("R1", "Ok"); };&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But i don't know how to get variable into position x and y, so i know how to get R1 resistor position by calling E.x and E.y but i can't + or - with above code so that i can center it inside resistor like tName have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i want to have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;B.elements(E) if (E.name == "R1") { cmd = "LINE 25 0.254 ((E.x + -0.950) (E.y + 0.635)) ((E.x + -0.950) (E.y + -0.635));"; exit(cmd); dlgMessageBox("R1", "Ok"); };&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So how to + and - variable ofset E.x and E.y with values that i define above so that i can center my custom font R inside center R?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 19:45:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8631065#M17868</guid>
      <dc:creator>ronovar</dc:creator>
      <dc:date>2019-03-01T19:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to write ULP script to replace all &gt;NAME and &gt;VALUE with my define</title>
      <link>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8632636#M17869</link>
      <description>I haven't heard of anyone creating a ulp to add custom fonts. If you get this working I would be very interested in trying it out.&lt;BR /&gt;&lt;BR /&gt;If you look at many of the ULPs included with Eagle you will notice that the output command is built up into a string. That string is what the final ulp will exit and run. So in your code you can add, subtract, multiply, and whatever else you need to do to the coordinates before running the command. I would suggest looking at the help file for sprintf and looking through some stock ulps. Some have different coding styles depending on how old they are.</description>
      <pubDate>Sun, 03 Mar 2019 07:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/eagle-forum/how-to-write-ulp-script-to-replace-all-gt-name-and-gt-value-with/m-p/8632636#M17869</guid>
      <dc:creator>C.Nicks</dc:creator>
      <dc:date>2019-03-03T07:02:17Z</dc:date>
    </item>
  </channel>
</rss>

