← Back to team overview

kicad-developers team mailing list archive

Re: Python LAYER_PAIR parameter for EXCELLON_WRITER().BuildHolesList()

 

Le 12/01/2017 à 12:05, Martin Schreiber a écrit :
> On Wednesday 11 January 2017 08:52:37 Martin Schreiber wrote:
>>
>> How must the LAYER_PAIR type parameter be defined in Python?
>>
> Similar problem with 
> "CreateDrillFile(EXCELLON_WRITER self, FILE * aFile) -> int".
> How to define "FILE * aFile"?
> "
> [...]
>   f1 = file(aoutputfile,'w')
>   drlwriter.CreateDrillFile(f1)
>   f1.close()
> [...]
> "
> returns:
> "
> Traceback (most recent call last):
>   File "<stdin>", line 4, in <module>
>   File "drillfile.py", line 33, in drillfile
>     drlwriter.CreateDrillFile(f1)
>   File "/usr/lib/python2.7/site-packages/pcbnew.py", line 10059, in 
> CreateDrillFile
>     return _pcbnew.EXCELLON_WRITER_CreateDrillFile(self, *args)
> TypeError: in method 'EXCELLON_WRITER_CreateDrillFile', argument 2 of 
> type 'FILE *'
> ".
> 
> Martin

It could be worth to explain us what exactly are you trying to do.
FILE is a basic C struct.
These methods are helper methods to create files, but are called by a higher lever method.

If you are trying to create a EXCELLON drill file (exactly a set of files), have a look into the demo:
gen_gerber_and_drill_files_board.py

-- 
Jean-Pierre CHARRAS


Follow ups

References