← Back to team overview

kicad-developers team mailing list archive

Re: Python Plugin - Use of advanced LSET Constructor

 

> In response to a message written on 02.03.2015, 01:26, from nats:
>> I add some details I got after more test. Maybe it should be considered
>> as a bug.
>> I can use this constructor: __init__(self, unsigned int aIdCount,
>> LAYER_ID aFirst, v(...) *args) -> LSET
>> But only if I put 1 layer in the list (with no respect for the aIdCount
>> value).
>> For example
>>      pcbnew.LSET(1, pcbnew.F_Cu) <= Works
>>      pcbnew.LSET(2, pcbnew.F_Cu) <= Works (but it shouldn't !)
>>      pcbnew.LSET(2, pcbnew.F_Cu, pcbnew.B_Cu) <= Doesn't Work but it
>> should.
>> The Error is indicated in the previous e-mail. Maybe there is a
>> confusion in the type of argument
>> linked to the Python Swig translation ?
> From some reason C++ input list form is incompatible with python
> list/tuple.
> Maybe might this help (ParseHex method):
> https://github.com/pierstitus/kicad-python/blob/master/pcbnew_easy.py
>
>
Thanks a lot for this information.
I managed to get it working, after some discussion on IRC I copied the
LSET code
inside the plugin.
It'll be removed when kicad python new api will be ready.
Here is the link for reference:
https://github.com/natsfr/kicad-components/blob/master/python_plugins/qfn_wizard.py
If you have any remark on the code don't hesitate.


Follow ups

References