← Back to team overview

kicad-developers team mailing list archive

Re: access IDF export function through python

 

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



On Thu, Dec 3, 2015 at 3:39 AM, Miguel Angel Ajo <mangelajo@xxxxxxxxxx>
wrote:

> We export functions from BOARD, modules, etc…, IMO, if we want to export
> that,
> “ExportToIDF3” may be a BOARD method (I haven’t looked at it yet), once
> that happens, ExportToIDF3 is available for python consumption.
>
> my_board.ExportToIDF3(“idf_file”)
>
>
> Best,
> Miguel Ángel Ajo
>
> On Wednesday 2 December 2015 at 17:35, easyw wrote:
>
> Hi Miguel and Cirilo,
>
> the function is
> void PCB_EDIT_FRAME::ExportToIDF3( wxCommandEvent& event )
>
> the best would be if that could be executed from a python call (included
> in pcbnew.py) ...
>
> a second thing that I would like to ask is the ability to have a button
> to be configured to execute a python file as if it would be invoked in
> pcbnew python console...
> That would make the way to execute a python script inside pcbnew more
> human than geek...
>
> thank you for your advices
>
> Maurice
>
> On 02/12/2015 13.22, Miguel Angel Ajo wrote:
>
> If you tell me which functions are those and how they relate to C++ code
> (I’ve never used them), I could tell you if it’s there, or how easy/hard
> it is.
>
> I’m adding cirilo bernardo to the thread :)
>
> Best,
> Miguel Ángel Ajo
>
> On Wednesday 2 December 2015 at 12:03, easyw wrote:
>
> Hi Miguel, could you please have a look at my query to tell me if this
> option is handled by KiCad?
>
> thank you
> Maurice
>
> On 27/11/2015 23.24, easyw wrote:
>
> Hi Miguel,
> is there a way to access IDF export function by a command in python with
> pcbnew APIs?
>
> Maurice
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx
> <kicad-developers@xxxxxxxxxxxxxxxxxxx>>
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx
> <kicad-developers@xxxxxxxxxxxxxxxxxxx>>
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>
>

Follow ups

References