EAGLE Central Forums
Where the EAGLE community meets. Sponsored by Stratford Digital.

Home » CadSoft Support Forums » eagle.support.eng » ULP: When iterating through parts, can I get to nets?
ULP: When iterating through parts, can I get to nets? [message #168268] Wed, 11 January 2017 04:37 Go to next message
Brad Bartley
Messages: 6
Registered: October 2015
Junior Member
I'm creating a ULP to export a netlist but for my purposes it would be a lot more direct to iterate through the parts, and export those one by one, specifying what net is on what pin. But the data structures visible via the ULP interface seem to only make it possible to see what parts are on a net (rather than what nets are attached to a part). Am I missing something, or am I going to have to build up a whole counterpart to the existing data structures to do what I need?

Thanks,
Brad

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/212804
Re: ULP: When iterating through parts, can I get to nets? [message #168269 is a reply to message #168268] Wed, 11 January 2017 06:20 Go to previous messageGo to next message
warrenbrayshaw
Messages: 1738
Registered: January 2010
Location: New Zealand
Senior Member
On 11/01/2017 5:37 p.m., bbartley wrote:
> I'm creating a ULP to export a netlist but for my purposes it would be a lot more direct to iterate through the parts, and export those one by one, specifying what net is on what pin. But the data structures visible via the ULP interface seem to only make it possible to see what parts are on a net (rather than what nets are attached to a part). Am I missing something, or am I going to have to build up a whole counterpart to the existing data structures to do what I need?
>
> Thanks,
> Brad
>
> --
> To view any images and attachments in this post, visit:
> https://www.element14.com/community/message/212804
>


Does File > Export > Pinlist not give you what you want without writing
a ulp?

Warren

--
.... use NNTP://news.cadsoft.de and a functional news reader like
Thunderbird!
.... or http://www.eaglecentral.ca browser access to CadSoft EAGLE
support forums.
Re: ULP: When iterating through parts, can I get to nets? [message #168270 is a reply to message #168268] Wed, 11 January 2017 07:32 Go to previous messageGo to next message
Morten Leikvoll
Messages: 1343
Registered: November 2007
Senior Member
On 11.01.2017 05:37, bbartley wrote:
> I'm creating a ULP to export a netlist but for my purposes it would be a lot more direct to iterate through the parts, and export those one by one, specifying what net is on what pin. But the data structures visible via the ULP interface seem to only make it possible to see what parts are on a net (rather than what nets are attached to a part). Am I missing something, or am I going to have to build up a whole counterpart to the existing data structures to do what I need?
>
> Thanks,
> Brad

Isn't this just a matter of sorting? From allnets(), loop through
pinrefs and store the net.name and part.name in two string arrays. Then
use sort().
Re: ULP: When iterating through parts, can I get to nets? [message #168271 is a reply to message #168270] Wed, 11 January 2017 07:36 Go to previous messageGo to next message
Morten Leikvoll
Messages: 1343
Registered: November 2007
Senior Member
On 11.01.2017 08:32, Morten Leikvoll wrote:
> On 11.01.2017 05:37, bbartley wrote:
>> I'm creating a ULP to export a netlist but for my purposes it would be
>> a lot more direct to iterate through the parts, and export those one
>> by one, specifying what net is on what pin. But the data structures
>> visible via the ULP interface seem to only make it possible to see
>> what parts are on a net (rather than what nets are attached to a
>> part). Am I missing something, or am I going to have to build up a
>> whole counterpart to the existing data structures to do what I need?
>>
>> Thanks,
>> Brad
>
> Isn't this just a matter of sorting? From allnets(), loop through
> pinrefs and store the net.name and part.name in two string arrays. Then
> use sort().
>
>
I was a bit quick. You may want to add the pin.name to that list so it
ends up like: part.name,pin.name,net.name
Re: ULP: When iterating through parts, can I get to nets? [message #168274 is a reply to message #168269] Wed, 11 January 2017 16:58 Go to previous messageGo to next message
Brad Bartley
Messages: 6
Registered: October 2015
Junior Member
Export -> Pinlist comes pretty close to generating something that I could post-process into what I need. But I also need to get to some attributes. (If pinlist export were implemented as a ULP, I would've been able to modify it trivially.)

I had completely overlooked the pinlist possibility though, so thanks for the suggestion!

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/212874
Re: ULP: When iterating through parts, can I get to nets? [message #168275 is a reply to message #168271] Wed, 11 January 2017 17:01 Go to previous message
Brad Bartley
Messages: 6
Registered: October 2015
Junior Member
Ahh, the extended functionality of sort() is what I was missing. So I *do* have to build up a counterpart data structure (the parallel string arrays), but sort() makes it easy to flip that around from net-centric to part-centric.

Thanks very much!

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/212875
Previous Topic: need eagle 7.6 library for 470, 680 or 1000uf 50v cap
Next Topic: How to create library part with thermal pad?
Goto Forum:
  


Current Time: Sun Apr 23 15:47:11 GMT 2017