delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2016/01/06/11:40:46

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Mailer: exmh version 2.8.0 04/21/2012 (debian 1:2.8.0~rc1-2) with nmh-1.5
X-Exmh-Isig-CompType: repl
X-Exmh-Isig-Folder: inbox
From: karl AT aspodata DOT se
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] Scripting pcb (was: A fileformat library)
In-reply-to: <CACwWb3BXbnQXs+DwVVzmC8DrhwOYxPgVyUhZTPL9bM9cJbHimw@mail.gmail.com>
References: <1512221837 DOT AA25291 AT ivan DOT Harhan DOT ORG> <CAJXU7q_qxdvJaejF-VcY=u7VHZ-zrfrc+Z7-qSwfFyPdy-umxw AT mail DOT gmail DOT com> <B02363CD-469D-493A-AC15-1D5DC7836982 AT noqsi DOT com> <20151222232230 DOT 12633 DOT qmail AT stuge DOT se> <0F6F1D0F-4F07-48EA-90FE-836EAD4E2354 AT noqsi DOT com> <CAM2RGhTficnys3a4xs=UBFvk8aPwpzYWUADFLP_pUQ+R1iKs0g AT mail DOT gmail DOT com> <0FCF3774-F93C-4BFF-BB61-636F75DCCACB AT noqsi DOT com> <CAC4O8c_UAiFE-vGfoE2tXppHLhaa0dSYz9o_rkdCBo7_SRRtxw AT mail DOT gmail DOT com> <FFBE7623-E240-4798-96B0-2BECF56C8E29 AT noqsi DOT com> <CAC4O8c980g1gj15=5njstC_BT-WYDgKQx9BRycdFKA8OvgtiOg AT mail DOT gmail DOT com> <B54C0E1F-1986-4C79-9F70-7F1919B8B26D AT noqsi DOT com> <CAC4O8c9bxJP1eMG4yz3YwKkQJRmsDGmLQ0aMd5pJRyu0WpdCtQ AT mail DOT gmail DOT com> <C1CFCCEE-C64A-4E49-AA64-446C061656D6 AT noqsi DOT com> <CAC4O8c-zt8B=joDd+ws77D2jt6aZf3MWfR_dAvpzGcNuBrTURQ AT mail DOT gmail DOT com> <alpine DOT DEB DOT 2 DOT 11 DOT 1601030040320 DOT 2176 AT newt> <D9825C8C-B6FD-4C7F-A8D5-B8AF06253B72 AT noqsi DOT com> <CAC4O8c_R5xWLmzj_cz0g0mPWNs6mR4efjXKGBoup8YO6nwnPTA AT mail DOT gmail DOT com> <CAC4O8c8cVr1H3skmbGo4Rhf5ZTZj8bDxJw8a9C4qf
HeGyXZ4XA AT mail DOT gmail DOT com> <20160106091006 DOT 5F67B809D7A1 AT turkos DOT aspodata DOT se> <CACwWb3CcsYJ9KgDFAa5pZqDzfTewhvbuatbxoKUp6PtHRCoa+w AT mail DOT gmail DOT com> <20160106133049 DOT 5A0E9809D79B AT turkos DOT aspodata DOT se> <CACwWb3Cyk4yLwt3=V1Mu5C4RieOQEjYH3ej5MXZSNnLPbshqDg AT mail DOT gmail DOT com> <20160106143629 DOT 4D39D809D79B AT turkos DOT aspodata DOT se> <CACwWb3BXbnQXs+DwVVzmC8DrhwOYxPgVyUhZTPL9bM9cJbHimw AT mail DOT gmail DOT com>
Comments: In-reply-to "Levente (leventelist AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
message dated "Wed, 06 Jan 2016 16:25:15 +0100."
Mime-Version: 1.0
Message-Id: <20160106164022.D0D4E809D79B@turkos.aspodata.se>
Date: Wed, 6 Jan 2016 17:40:22 +0100 (CET)
X-Virus-Scanned: ClamAV using ClamSMTP
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Levente:
> I'd make such API calls, for example move (change coordinate) of object,
> add new, or iterate through objects.

If you want scripting outside of pcb, then I don't know about anything 
currently available. If we make a simple parsing thing that gives you a 
parse tree, could that be something to start tinkering with.
First is some header things, then a list of "Symbol", Grid setting, 
Vias, elements, then list of layers which contains lines, arcs, text 
and polygons; followed by a list of nets. Given that you could do
something like:

pcb.read(myfile.pcb);
pcb.layer[1].line[14].x1 += 122;
pcb.layer[1].line[14].y1 -= 33;
pcb.export_ps(excellent_design.ps);

one could implement search queries:

my_line = find_line(pcb.layer[1], x1 > 299 && width < 13);

in whatever language you'd use.

Would that be something ?

///

For scripting, why don't you try out Igor2's pcb-rnd, he has 
implemented scripting. See

 http://www.delorie.com/archives/browse.cgi?p=geda-user/2016/01/06/06:44:34

and report back goods and bads.

///

Or, you can help by looking through action scrips and see what can be 
improved. I tried this little script

Select(All)
Mode(Move)
MovePointer(100, 100)

but I got ":unknown action `MovePointer'", so a lot could be improved 
there.

///

Can a plugin solve your need, I don't know much about pcb's plugins.

> If we talk about SQL implementation,
> that would be fairly easy to implement with SQL queries inside the library.

Well, now you are talking about bypassing the lib :)

But given a parsetree, it wouldn't be hard to export it to some sql and 
do queries there, somehow correlate what's in memory with the answer or 
import from sql, do your stuff, and then save it.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019