Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Does anybody here write Eagle ULPs?

Status
Not open for further replies.

Mr RB

Well-Known Member
Hi, I'm trying to write a ULP for Eagle that directly accesses the coordinates for each components origin (the little crosshairs for the centre of the component).

The closest ULP I have seen was for SMD parts, and gets the coords for all the pads then finds the centre between the furthest pads and uses that for the component coords, but that does not work well on non-symmetrical parts like transistors etc.

Does anyone know how to directly access the component origin? I think it's just a matter of knowing what the internal variable name is?
 
I find references to Layer 24 being bOrigins. Component origins are local I'm guessing that the bOrigins layer is global at least within in it's scope. This is territory rife for math errors.
 
Last edited:
Thanks for the info Sceadwian. :)

For the moment I'm just working with the pad averages, and manual checking of asymmetrical components. I'll check the bOrigins and tOrigins layers later.
 
I can't read the programs, but it appears "mount-marks.ulp" is finding and using the defined origins of smd and other components.

Are you sure you want the origins as shown, rather than one calculated from the pads? I believe whoever makes the package can put the origin anywhere he wants it. It is not always in the same relationship to the pads as another origin might be.

For that reason, I suspect a location specified relative to the outline or pads would be more reliable from an electronic standpoint.

BTW, a rather small detail, a 3-pin smd transistor is not symmetrical in my view.

John
 
Last edited:
Thnak you Jpanhalt, you found it! I did not have "mount-marks.ULP" in my folder, I haven't been updating Eagle much over the years.

That ULP has the direct references to the origin coords;
u2mm(E.x), Tab, u2mm(E.y), Tab,
and it looks as simple as E.x is the part origin X coord etc. So job done, thank you very much! :D

I agree with you that a 3pin SMD transistor is "not symmetrical" that was actually my point! That's why I wanted the actual component origin coords, so the text file generated by the ULP could be cross checked with the actual origins shown on the screen.
Thanks again!
 
Just an update for the people who helped, yep that works fine. The variables E.x and E.y return the origin X and Y coords for the components. I was able to modify a copy of the "mount-marks.ULP" file to create a text file of the origin coords in the format I wanted.

Thanks again guys. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top