Add GetCurrentSelection() python scripting helper
This commit is contained in:
parent
366c3e7142
commit
f153ff8453
|
@ -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();
|
||||
|
|
|
@ -167,6 +167,11 @@ void UpdateUserInterface();
|
|||
*/
|
||||
int GetUserUnits();
|
||||
|
||||
/**
|
||||
* Get the list of selected objects.
|
||||
*/
|
||||
std::deque<BOARD_ITEM*> GetCurrentSelection();
|
||||
|
||||
/**
|
||||
* Are we currently in an action plugin?
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue