Skip to content

Commit

Permalink
fab positions compatible kv5,kv6,kv7
Browse files Browse the repository at this point in the history
  • Loading branch information
easyw committed Mar 3, 2023
1 parent 94ae19a commit 15c0c97
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions FabricationPositions/fabrication_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#pcbnew.GetWizardsBackTrace()


___version___="1.2.9"
___version___="1.3.0"
#wx.LogMessage("My message")
#mm_ius = 1000000.0

Expand All @@ -29,6 +29,19 @@
execfile ("C:/kicad-wb-1602/msys64/home/userC/out3Dm/pack-x86_64/share/kicad/scripting/plugins/getpos.py")
"""

# Make positions compatible with KiCAD 7.0
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
pass
else: # kv7
wxPoint = VECTOR2I

def getOrientation(fp):
o = fp.GetOrientation()
if hasattr(pcbnew, 'EDA_RECT'): # kv5,kv6
return o / 10
else: # kv7
return o.AsDegrees()

def find_pcbnew_w():
windows = wx.GetTopLevelWindows()
pcbneww = [w for w in windows if "pcbnew" in w.GetTitle().lower()]
Expand Down Expand Up @@ -183,7 +196,7 @@ def generate_POS(dir):
PIN1_YPOS="{0:<11}".format(PIN1_YPOS)
break

Rotation='{0:.1f}'.format((module.GetOrientation()/10))
Rotation='{0:.1f}'.format((getOrientation(module)/10))
Rotation="{0:>6}".format(Rotation)+' '
if module.GetLayer() == 0:
Layer=" top"
Expand Down

0 comments on commit 15c0c97

Please sign in to comment.