diff --git a/pcbnew/class_mire.h b/pcbnew/class_mire.h index 01bbf40302..03bebba9fc 100644 --- a/pcbnew/class_mire.h +++ b/pcbnew/class_mire.h @@ -84,6 +84,11 @@ public: bool HitTest( const wxPoint& aPosition ) const; + wxString GetClass() const + { + return wxT( "PCB_TARGET" ); + } + /** @copydoc BOARD_ITEM::HitTest(const EDA_RECT& aRect, * bool aContained = true, int aAccuracy ) const */ diff --git a/pcbnew/scripting/board_item.i b/pcbnew/scripting/board_item.i index 42a421de04..93f3026491 100644 --- a/pcbnew/scripting/board_item.i +++ b/pcbnew/scripting/board_item.i @@ -47,8 +47,9 @@ EDGE_MODULE* Cast_to_EDGE_MODULE() { return dynamic_cast(self); } D_PAD* Cast_to_D_PAD() { return dynamic_cast(self); } TRACK* Cast_to_TRACK() { return dynamic_cast(self); } - ZONE_CONTAINER* Cast_to_ZONE_CONTAINER() { return dynamic_cast(self);} VIA* Cast_to_VIA() { return dynamic_cast(self); } + ZONE_CONTAINER* Cast_to_ZONE_CONTAINER() { return dynamic_cast(self);} + PCB_TARGET* Cast_to_PCB_TARGET() { return dynamic_cast(self); } %pythoncode @@ -77,6 +78,8 @@ return self.Cast_to_VIA() elif ct=="TRACK": return self.Cast_to_TRACK() + elif ct=="PCB_TARGET": + return self.Cast_to_PCB_TARGET() elif ct=="ZONE_CONTAINER": return self.Cast_to_ZONE_CONTAINER() else: diff --git a/pcbnew/scripting/pcbnew.i b/pcbnew/scripting/pcbnew.i index 6c50e1b3f1..dcb791f3ea 100644 --- a/pcbnew/scripting/pcbnew.i +++ b/pcbnew/scripting/pcbnew.i @@ -97,6 +97,7 @@ #include #include #include + #include #include #include #include @@ -133,6 +134,7 @@ %include %include %include +%include %include %include %include