← Back to team overview

kicad-developers team mailing list archive

Re: access IDF export function through python

 

@cirilo
thank you for pointing out the right function...

@cirilo @miguel
the mcad exporter can now handle all the IDF options...
so feel free to implement the python handle as best for your code...

@miguel
it would be also fine to execute the code inside the python console, if the command / file.py could be invoked by a button/menu action...
that would be still a user-friendly way to launch a python function/file

It would be fantastic if you could do something in the upcoming holidays :)

thank you
Maurice

On 03/12/2015 15.45, Miguel Angel wrote:
@cirilo:

Hmm, given that, we could swig in the main exporter functions to make
them available for python,
I see that for example in VRML you're defining a PCB_FRAME method.

@maurice:

Sounds to me like a doable thing, it was once in my plan to introduce
not only plugin wizards, but other kind of plugins, like hooks for the
toolbar, the context menus (so you could exec a script over certain
types of pcbs items, or selections).

Not sure how easy is to throw the execution out into the console, but
that'd be ideal, yes.


Seems like a possibility for christmas holidays ;)




---
irc: ajo / mangelajo
Miguel Angel Ajo Pelayo
+34 636 52 25 69
skype: ajoajoajo

On Thu, Dec 3, 2015 at 12:59 AM, Cirilo Bernardo
<cirilo.bernardo@xxxxxxxxx <mailto:cirilo.bernardo@xxxxxxxxx>> wrote:

    The export function which Maurice mentioned is a dialog.
    The export function is in pcbnew/exporters/export_idf.cpp :

    bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, bool
    aUseThou,
                       double aXRef, double aYRef )

    aFullFileName: full path for the output file and should end in
    ".emn"; a second file is
         also generated with ".emp" extension.

    aUseThou: set true if the IDF output should use 0.001inch as the
    units ('mil' in the USA,
         but Australians call it 'thou' and get confused and use mm if
    you mention 'mil'). The
         default of course is mm.

    aXRef, aYRef: (0,0) position of the board, in mm. It doesn't matter
    if the board is designed on
         an imperial grid, this reference is always specified in mm.

    I can't remember if Maurice's scripts need the reference at (0,0) or
    if it's determined by:

             aXRef = bbox.Centre().x * MM_PER_IU;
             aYRef = bbox.Centre().y * MM_PER_IU;

    - Cirilo





References