GetProperties does not reflect current PCBState


I am wondering where GetProperty() takes the information from. I have an additional field in the symbol for the Pick and Place Rotation Offset. If it is updated in the schematic via the fields editor this change is reflected in the pcb (file) aswell. But when exporting the production file via python, GetProperty() does still return the old value? Is it accessing the library instead of the footprint of the board?

    footprint : FOOTPRINT
    for footprint in board.Footprints():
        if footprint.HasProperty("PnPRotationOffset"):
            erp_offset = footprint.GetProperty("PnPRotationOffset")

Never mind, I am an idiot. I made a copy beforehand and was operation on the copy instead of the original…

But maybe someone can point out what’s the difference between GetProperty() and GetPropertyNative()

GetProperty(...) throws a KeyError("Property not found: " + key) when the key argument isn’t found. GetPropertyNative doesn’t do this, but not sure if it returns null instead or throws another error. In any case, there’s probable no real difference outside of error handling.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.