self.area.HitTestFilledArea(self.area.GetLayer(), item.GetPosition(), 0)

I’m having this error:

C:\Users\celinp14>AttributeError("module 'pcbnew' has no attribute 'GR_TEXT_HJUSTIFY_LEFT'")
Traceback (most recent call last):
  File "C:\Users\celinp14\Documents\KiCad\7.0\3rdparty\plugins\viastitching\viastitching_dialog.py", line 445, in onProcessAction
    self.FillupArea()
  File "C:\Users\celinp14\Documents\KiCad\7.0\3rdparty\plugins\viastitching\viastitching_dialog.py", line 362, in FillupArea
    if self.area.HitTestFilledArea(layer, p, 0):
  File "C:\Program Files\KiCad\7.0\bin\Lib\site-packages\pcbnew.py", line 13635, in HitTestFilledArea
    return _pcbnew.ZONE_HitTestFilledArea(self, aLayer, aRefPos, aAccuracy)
TypeError: in method 'ZONE_HitTestFilledArea', argument 3 of type 'VECTOR2I const &'
Additional information:
Wrong number or type of arguments for overloaded function 'ZONE_HitTestFilledArea'.
  Possible C/C++ prototypes are:
    ZONE::HitTestFilledArea(PCB_LAYER_ID,VECTOR2I const &,int) const
    ZONE::HitTestFilledArea(PCB_LAYER_ID,VECTOR2I const &) const

Running my plugin… this’s the line of code that rise such exception:

self.area.HitTestFilledArea(self.area.GetLayer(), item.GetPosition(), 0)

I cannot understand where’s the problem.

What type does that return? Probably not VECTOR2I.
If you are migrating from v6 code it likely used wxPoint, which is mostly replaced by VECTOR2I in v7.

Also read this 6.0.x → 6.99 pcbnew python bindings changes

1 Like

Oh yeah sorry I got confused by the error and I forgot to check the inner function return type. My fault.

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