Add GetCurrentSelection() python scripting helper

This commit is contained in:
qu1ck
2023-01-10 16:39:48 +00:00
committed by Seth Hillbrand
parent 366c3e7142
commit f153ff8453
2 changed files with 24 additions and 0 deletions
@@ -418,6 +418,25 @@ int GetUserUnits()
}
std::deque<BOARD_ITEM*> GetCurrentSelection()
{
std::deque<BOARD_ITEM*> items;
if( s_PcbEditFrame )
{
SELECTION& selection = s_PcbEditFrame->GetCurrentSelection();
std::for_each( selection.begin(), selection.end(),
[&items]( EDA_ITEM* item )
{
items.push_back( static_cast<BOARD_ITEM*>( item ) );
} );
}
return items;
}
bool IsActionRunning()
{
return ACTION_PLUGINS::IsActionRunning();