6.0.x → 6.99 pcbnew python bindings changes

I am posting this for anybody else who will port pcbnew python code from 6.0.x to 6.99 (7.0.x to be). Feel free to expand on this.

  • introduction of pcbnew.VECTOR2I. Code that previously worked with wxPoint as an argument/return value now works with pcbnew.VECTOR2I objects (positions, bounding boxes, …)

  • introduction of pcbnew.EDA_ANGLE. Code that previously worked with doubles as an argument/return value for angular orientation of items now works with pcbnew.EDA_ANGLE. Simplest solution is to convert pcbnew.EDA_ANGLE to double via AsDegrees() method and use SetOrientationDegrees method to set orientation. If this is not available you can create pcbnew.EDA_ANGLE( angle ,EDA_ANGLE_T) where EDA_ANGLE_T can be either pcbnew.TENTHS_OF_A_DEGREE_T or pcbnew.DEGREE_T.

  • removal of pcbnew.EDA_RECT. It can be substituted by pcbnew.BOX2I. pcbnew.BOX2I obviously works with pcbnew.VECTOR2I instead of wxPoint.

  • removal of pcbnew.ZONE.IsKeepout(). You can now use pcbnew.ZONE.GetIsRuleArea()

  • removal of Millimeter2iu. You can now use FromMM

8 Likes

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