From 251cbbd28730411027c553e5fd926ceca0bc3db0 Mon Sep 17 00:00:00 2001 From: Jon Evans <jon@craftyjon.com> Date: Sun, 17 Nov 2024 16:22:40 -0500 Subject: [PATCH] Handle PCB_SHAPE in GetItems API --- pcbnew/api/api_handler_pcb.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pcbnew/api/api_handler_pcb.cpp b/pcbnew/api/api_handler_pcb.cpp index fe0155ef5c..7da1e513fd 100644 --- a/pcbnew/api/api_handler_pcb.cpp +++ b/pcbnew/api/api_handler_pcb.cpp @@ -417,6 +417,24 @@ HANDLER_RESULT<GetItemsResponse> API_HANDLER_PCB::handleGetItems( GetItems& aMsg break; } + case PCB_SHAPE_T: + { + handledAnything = true; + bool inserted = false; + + for( BOARD_ITEM* item : board->Drawings() ) + { + if( item->Type() == PCB_SHAPE_T ) + { + items.emplace_back( item ); + inserted = true; + } + } + + if( inserted ) + typesInserted.insert( PCB_SHAPE_T ); + } + default: break; }