-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
In the process of making a PCB I figured I'd make my own footprint "for the sake of simplicity" so I had to change about a hundred symbol-footprint associations:
>>> sch=Schematic("fold_passings.kicad_sch")
>>> sch.symbol.JP44.property
<Collection [<PropertyString Reference = 'JP44'>, <PropertyString Value = 'Jumper_2_Bridged'>, <PropertyString Footprint = 'Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm'>, <PropertyString Datasheet = '~'>, <PropertyString Description = 'Jumper, 2-pole, closed/bridged'>]>
>>> sch.symbol.JP44.property.elementRemove('Footprint')
>>> sch.symbol.JP44.property.elementAdd('Footprint','compuchair:FoldPassing')
>>> sch.symbol.JP44.property
# no change:
>>> sch.symbol.JP44.property
<Collection [<PropertyString Reference = 'JP44'>, <PropertyString Value = 'Jumper_2_Bridged'>, <PropertyString Footprint = 'Jumper:SolderJumper-2_P1.3mm_Bridged_RoundedPad1.0x1.5mm'>, <PropertyString Datasheet = '~'>, <PropertyString Description = 'Jumper, 2-pole, closed/bridged'>]>
>>> sch.symbol.JP44.property.Footprint.value = 'compuchair:FoldPassing'
# still no change
>>> sch.symbol.JP44.property.Footprint.value = 'compuchair:FoldPassing'
AttributeError: 'str' object has no attribute 'value'
>>> sch.symbol.JP44.property['Footprint'].value = 'compuchair:FoldPassing'
TypeError: list indices must be integers or slices, not str
# make an educated guess on the index
>>> sch.symbol.JP44.property[2].value = 'compuchair:FoldPassing'
# success!
obviously, something a little more intuitive and user-friendly is desired, but I will not go as far as making a suggestion (I'll leave this to those who know the codebase better)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels