KiCad PCB EDA Suite
pcbnew_scripting_helpers.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo <[email protected]>
5 * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
30#include <Python.h>
31#undef HAVE_CLOCK_GETTIME // macro is defined in Python.h and causes redefine warning
32
34
35#include <action_plugin.h>
36#include <board.h>
38#include <pcb_marker.h>
39#include <cstdlib>
40#include <drc/drc_engine.h>
41#include <drc/drc_item.h>
42#include <fp_lib_table.h>
43#include <ignore.h>
44#include <io_mgr.h>
45#include <string_utils.h>
46#include <macros.h>
48#include <project.h>
52#include <specctra.h>
55#include <locale_io.h>
56#include <wx/app.h>
57
58
61
62
64{
65 if( s_PcbEditFrame )
66 return s_PcbEditFrame->GetBoard();
67 else
68 return nullptr;
69}
70
71
73{
74 s_PcbEditFrame = aPcbEditFrame;
75}
76
77
78BOARD* LoadBoard( wxString& aFileName )
79{
80 if( aFileName.EndsWith( KiCadPcbFileExtension ) )
81 return LoadBoard( aFileName, IO_MGR::KICAD_SEXP );
82 else if( aFileName.EndsWith( LegacyPcbFileExtension ) )
83 return LoadBoard( aFileName, IO_MGR::LEGACY );
84
85 // as fall back for any other kind use the legacy format
86 return LoadBoard( aFileName, IO_MGR::LEGACY );
87}
88
89
91{
93 {
94 if( s_PcbEditFrame )
95 {
97 }
98 else
99 {
100 // Ensure wx system settings stuff is available
101 ignore_unused( wxTheApp );
103 }
104 }
105
106 return s_SettingsManager;
107}
108
109
111{
112 // For some reasons, LoadProject() needs a C locale, so ensure we have the right locale
113 // This is mainly when running QA Python tests
115
117
118 if( !project )
119 {
122 }
123
124 return project;
125}
126
127
128BOARD* LoadBoard( wxString& aFileName, IO_MGR::PCB_FILE_T aFormat )
129{
130 wxFileName pro = aFileName;
131 pro.SetExt( ProjectFileExtension );
132 pro.MakeAbsolute();
133 wxString projectPath = pro.GetFullPath();
134
135 // Ensure the "C" locale is temporary set, before reading any file
136 // It also avoid wxWidget alerts about locale issues, later, when using Python 3
138
139 PROJECT* project = GetSettingsManager()->GetProject( projectPath );
140
141 if( !project )
142 {
143 if( wxFileExists( projectPath ) )
144 {
145 GetSettingsManager()->LoadProject( projectPath, false );
146 project = GetSettingsManager()->GetProject( projectPath );
147 }
148 }
149 else if( s_PcbEditFrame && project == &GetSettingsManager()->Prj() )
150 {
151 // Project is already loaded? Then so is the board
152 return s_PcbEditFrame->GetBoard();
153 }
154
155 // Board cannot be loaded without a project, so create the default project
156 if( !project )
158
159 BOARD* brd = IO_MGR::Load( aFormat, aFileName );
160
161 if( brd )
162 {
163 brd->SetProject( project );
164
165 // Move legacy view settings to local project settings
166 if( !brd->m_LegacyVisibleLayers.test( Rescue ) )
167 project->GetLocalSettings().m_VisibleLayers = brd->m_LegacyVisibleLayers;
168
170 project->GetLocalSettings().m_VisibleItems = brd->m_LegacyVisibleItems;
171
173 bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( brd, &bds );
174
175 try
176 {
177 wxFileName rules = pro;
178 rules.SetExt( DesignRulesFileExtension );
179 bds.m_DRCEngine->InitEngine( rules );
180 }
181 catch( ... )
182 {
183 // Best efforts...
184 }
185
186 for( PCB_MARKER* marker : brd->ResolveDRCExclusions() )
187 brd->Add( marker );
188
189 brd->BuildConnectivity();
190 brd->BuildListOfNets();
191 brd->SynchronizeNetsAndNetClasses( false );
192 }
193
194 return brd;
195}
196
197
198BOARD* NewBoard( wxString& aFileName )
199{
200 wxFileName boardFn = aFileName;
201 wxFileName proFn = aFileName;
202 proFn.SetExt( ProjectFileExtension );
203 proFn.MakeAbsolute();
204
205 wxString projectPath = proFn.GetFullPath();
206
207 // Ensure the "C" locale is temporary set, before reading any file
208 // It also avoids wxWidgets alerts about locale issues, later, when using Python 3
210
211 GetSettingsManager()->LoadProject( projectPath, false );
212 PROJECT* project = GetSettingsManager()->GetProject( projectPath );
213
214 BOARD* brd = new BOARD();
215
216 brd->SetProject( project );
218 bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( brd, &bds );
219
220 SaveBoard( aFileName, brd );
221
222 return brd;
223}
224
225
227{
228 // Creating a new board is not possible if running inside KiCad
229 if( s_PcbEditFrame )
230 return nullptr;
231
232 BOARD* brd = new BOARD();
233
235
236 return brd;
237}
238
239
240bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings )
241{
242 aBoard->BuildConnectivity();
243 aBoard->SynchronizeNetsAndNetClasses( false );
244
245 // Ensure the "C" locale is temporary set, before saving any file
246 // It also avoid wxWidget alerts about locale issues, later, when using Python 3
248
249 try
250 {
251 IO_MGR::Save( aFormat, aFileName, aBoard, nullptr );
252 }
253 catch( ... )
254 {
255 return false;
256 }
257
258 if( !aSkipSettings )
259 {
260 wxFileName pro = aFileName;
261 pro.SetExt( ProjectFileExtension );
262 pro.MakeAbsolute();
263
264 GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
265 }
266
267 return true;
268}
269
270
271bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings )
272{
273 return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP, aSkipSettings );
274}
275
276
278{
279 BOARD* board = GetBoard();
280
281 if( !board )
282 return nullptr;
283
284 PROJECT* project = board->GetProject();
285
286 if( !project )
287 return nullptr;
288
289 return project->PcbFootprintLibs();
290}
291
292
294{
295 wxArrayString footprintLibraryNames;
296
298
299 if( !tbl )
300 return footprintLibraryNames;
301
302 for( const wxString& name : tbl->GetLogicalLibs() )
303 footprintLibraryNames.Add( name );
304
305 return footprintLibraryNames;
306}
307
308
309wxArrayString GetFootprints( const wxString& aNickName )
310{
311 wxArrayString footprintNames;
312
314
315 if( !tbl )
316 return footprintNames;
317
318 tbl->FootprintEnumerate( footprintNames, aNickName, true );
319
320 return footprintNames;
321}
322
323
324bool ExportSpecctraDSN( wxString& aFullFilename )
325{
326 if( s_PcbEditFrame )
327 {
328 bool ok = s_PcbEditFrame->ExportSpecctraFile( aFullFilename );
329 return ok;
330 }
331 else
332 {
333 return false;
334 }
335}
336
337
338bool ExportSpecctraDSN( BOARD* aBoard, wxString& aFullFilename )
339{
340 try
341 {
342 ExportBoardToSpecctraFile( aBoard, aFullFilename );
343 }
344 catch( ... )
345 {
346 return false;
347 }
348
349 return true;
350}
351
352
353bool ExportVRML( const wxString& aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles,
354 bool aUseRelativePaths, const wxString& a3D_Subdir, double aXRef, double aYRef )
355{
356 if( s_PcbEditFrame )
357 {
358 bool ok = s_PcbEditFrame->ExportVRML_File( aFullFileName, aMMtoWRMLunit,
359 aExport3DFiles, aUseRelativePaths,
360 a3D_Subdir, aXRef, aYRef );
361 return ok;
362 }
363 else
364 {
365 return false;
366 }
367}
368
369bool ImportSpecctraSES( wxString& aFullFilename )
370{
371 if( s_PcbEditFrame )
372 {
373 bool ok = s_PcbEditFrame->ImportSpecctraSession( aFullFilename );
374 return ok;
375 }
376 else
377 {
378 return false;
379 }
380}
381
382
383bool ExportFootprintsToLibrary( bool aStoreInNewLib, const wxString& aLibName, wxString* aLibPath )
384{
385 if( s_PcbEditFrame )
386 {
387 s_PcbEditFrame->ExportFootprintsToLibrary( aStoreInNewLib, aLibName, aLibPath );
388 return true;
389 }
390 else
391 {
392 return false;
393 }
394}
395
397{
398 if( s_PcbEditFrame )
399 {
401 }
402}
403
404
406{
407 if( s_PcbEditFrame )
409}
410
411
413{
414 if( s_PcbEditFrame )
415 return static_cast<int>( s_PcbEditFrame->GetUserUnits() );
416
417 return -1;
418}
419
420
421std::deque<BOARD_ITEM*> GetCurrentSelection()
422{
423 std::deque<BOARD_ITEM*> items;
424
425 if( s_PcbEditFrame )
426 {
428
429 std::for_each( selection.begin(), selection.end(),
430 [&items]( EDA_ITEM* item )
431 {
432 items.push_back( static_cast<BOARD_ITEM*>( item ) );
433 } );
434 }
435
436 return items;
437}
438
439
441{
443}
444
445
446bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
447 bool aReportAllTrackErrors )
448{
449 wxCHECK( aBoard, false );
450
452 std::shared_ptr<DRC_ENGINE> engine = bds.m_DRCEngine;
453 UNITS_PROVIDER unitsProvider( pcbIUScale, aUnits );
454
455 if( !engine )
456 {
457 bds.m_DRCEngine = std::make_shared<DRC_ENGINE>( aBoard, &bds );
458 engine = bds.m_DRCEngine;
459 }
460
461 wxCHECK( engine, false );
462
463 wxFileName fn = aBoard->GetFileName();
464 fn.SetExt( DesignRulesFileExtension );
465 PROJECT* prj = nullptr;
466
467 if( aBoard->GetProject() )
468 prj = aBoard->GetProject();
469 else if( s_SettingsManager )
470 prj = &s_SettingsManager->Prj();
471
472 wxCHECK( prj, false );
473
474 wxString drcRulesPath = prj->AbsolutePath( fn.GetFullName() );
475
476 // Rebuild The Instance of ENUM_MAP<PCB_LAYER_ID> (layer names list), because the DRC
477 // engine can use layer names (canonical and/or user names)
479 layerEnum.Choices().Clear();
480 layerEnum.Undefined( UNDEFINED_LAYER );
481
482 for( LSEQ seq = LSET::AllLayersMask().Seq(); seq; ++seq )
483 {
484 layerEnum.Map( *seq, LSET::Name( *seq ) ); // Add Canonical name
485 layerEnum.Map( *seq, aBoard->GetLayerName( *seq ) ); // Add User name
486 }
487
488 try
489 {
490 engine->InitEngine( drcRulesPath );
491 }
492 catch( PARSE_ERROR& err )
493 {
494 fprintf( stderr, "Init DRC engine: err <%s>\n", TO_UTF8( err.What() ) ); fflush( stderr);
495 return false;
496 }
497
498 std::vector<std::shared_ptr<DRC_ITEM>> footprints;
499 std::vector<std::shared_ptr<DRC_ITEM>> unconnected;
500 std::vector<std::shared_ptr<DRC_ITEM>> violations;
501
502 engine->SetProgressReporter( nullptr );
503
504 engine->SetViolationHandler(
505 [&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2D aPos, int aLayer )
506 {
507 if( aItem->GetErrorCode() == DRCE_MISSING_FOOTPRINT
508 || aItem->GetErrorCode() == DRCE_DUPLICATE_FOOTPRINT
509 || aItem->GetErrorCode() == DRCE_EXTRA_FOOTPRINT
510 || aItem->GetErrorCode() == DRCE_NET_CONFLICT )
511 {
512 footprints.push_back( aItem );
513 }
514 else if( aItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
515 {
516 unconnected.push_back( aItem );
517 }
518 else
519 {
520 violations.push_back( aItem );
521 }
522 } );
523
524 engine->RunTests( aUnits, aReportAllTrackErrors, false );
525 engine->ClearViolationHandler();
526
527 // TODO: Unify this with DIALOG_DRC::writeReport
528
529 FILE* fp = wxFopen( aFileName, wxT( "w" ) );
530
531 if( fp == nullptr )
532 return false;
533
534 std::map<KIID, EDA_ITEM*> itemMap;
535 aBoard->FillItemMap( itemMap );
536
537 fprintf( fp, "** Drc report for %s **\n", TO_UTF8( aBoard->GetFileName() ) );
538
539 wxDateTime now = wxDateTime::Now();
540
541 fprintf( fp, "** Created on %s **\n", TO_UTF8( now.Format( wxT( "%F %T" ) ) ) );
542
543 fprintf( fp, "\n** Found %d DRC violations **\n", static_cast<int>( violations.size() ) );
544
545 for( const std::shared_ptr<DRC_ITEM>& item : violations )
546 {
547 SEVERITY severity = item->GetParent() ? item->GetParent()->GetSeverity()
548 : bds.GetSeverity( item->GetErrorCode() );
549 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
550 }
551
552 fprintf( fp, "\n** Found %d unconnected pads **\n", static_cast<int>( unconnected.size() ) );
553
554 for( const std::shared_ptr<DRC_ITEM>& item : unconnected )
555 {
556 SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
557 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
558 }
559
560 fprintf( fp, "\n** Found %d Footprint errors **\n", static_cast<int>( footprints.size() ) );
561
562 for( const std::shared_ptr<DRC_ITEM>& item : footprints )
563 {
564 SEVERITY severity = bds.GetSeverity( item->GetErrorCode() );
565 fprintf( fp, "%s", TO_UTF8( item->ShowReport( &unitsProvider, severity, itemMap ) ) );
566 }
567
568 fprintf( fp, "\n** End of Report **\n" );
569 fclose( fp );
570
571 return true;
572}
const char * name
Definition: DXF_plotter.cpp:56
Class PCBNEW_ACTION_PLUGINS.
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
static bool IsActionRunning()
Container for design settings for a BOARD object.
std::shared_ptr< DRC_ENGINE > m_DRCEngine
SEVERITY GetSeverity(int aDRCErrorCode)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:269
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
Definition: board.cpp:772
GAL_SET m_LegacyVisibleItems
Definition: board.h:345
void BuildListOfNets()
Definition: board.h:763
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
Definition: board.cpp:166
void SynchronizeNetsAndNetClasses(bool aResetTrackAndViaSizes)
Copy NETCLASS info to each NET, based on NET membership in a NETCLASS.
Definition: board.cpp:1546
LSET m_LegacyVisibleLayers
Visibility settings stored in board prior to 6.0, only used for loading legacy files.
Definition: board.h:344
void SetProject(PROJECT *aProject, bool aReferenceOnly=false)
Link a board to a given project.
Definition: board.cpp:176
const wxString & GetFileName() const
Definition: board.h:306
void FillItemMap(std::map< KIID, EDA_ITEM * > &aMap)
Definition: board.cpp:1098
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
Definition: board.cpp:474
PROJECT * GetProject() const
Definition: board.h:446
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:704
std::vector< PCB_MARKER * > ResolveDRCExclusions()
Rebuild DRC markers from the serialized data in BOARD_DESIGN_SETTINGS.
Definition: board.cpp:304
SETTINGS_MANAGER * GetSettingsManager() const
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:85
ENUM_MAP & Map(T aValue, const wxString &aName)
Definition: property.h:629
static ENUM_MAP< T > & Instance()
Definition: property.h:623
ENUM_MAP & Undefined(T aValue)
Definition: property.h:636
wxPGChoices & Choices()
Definition: property.h:672
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aNickname, bool aBestEfforts)
Return a list of footprint names contained within the library given by aNickname.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
PCB_FILE_T
The set of file types that the IO_MGR knows about, and for which there has been a plugin written.
Definition: io_mgr.h:54
@ LEGACY
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:55
@ KICAD_SEXP
S-expression Pcbnew file format.
Definition: io_mgr.h:56
static BOARD * Load(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aAppendToMe=nullptr, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Find the requested PLUGIN and if found, calls the PLUGIN::Load() function on it using the arguments p...
Definition: io_mgr.cpp:162
static void Save(PCB_FILE_T aFileType, const wxString &aFileName, BOARD *aBoard, const STRING_UTF8_MAP *aProperties=nullptr)
Write either a full aBoard to a storage file in a format that this implementation knows about,...
Definition: io_mgr.cpp:178
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:41
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
Definition: layer_ids.h:493
static LSET AllLayersMask()
Definition: lset.cpp:808
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:82
BOARD * GetBoard() const
The main frame for Pcbnew.
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
void ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName=wxEmptyString, wxString *aLibPath=nullptr)
Save footprints in a library:
bool ImportSpecctraSession(const wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
bool ExportVRML_File(const wxString &aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Create the file(s) exporting current BOARD to a VRML file.
void RebuildAndRefresh()
Rebuilds board connectivity, refreshes canvas.
SELECTION & GetCurrentSelection() override
Get the current selection from the canvas area.
bool ExportSpecctraFile(const wxString &aFullFilename)
Export the current BOARD to a specctra dsn file.
Container for project specific data.
Definition: project.h:64
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
Definition: project.cpp:305
ITER end()
Definition: selection.h:74
ITER begin()
Definition: selection.h:73
void SaveProjectAs(const wxString &aFullPath, PROJECT *aProject=nullptr)
Sets the currently loaded project path and saves it (pointers remain valid) Note that this will not m...
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieves a loaded project by name.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
EDA_UNITS GetUserUnits() const
@ DRCE_UNCONNECTED_ITEMS
Definition: drc_item.h:39
@ DRCE_DUPLICATE_FOOTPRINT
Definition: drc_item.h:71
@ DRCE_EXTRA_FOOTPRINT
Definition: drc_item.h:72
@ DRCE_NET_CONFLICT
Definition: drc_item.h:73
@ DRCE_MISSING_FOOTPRINT
Definition: drc_item.h:70
EDA_UNITS
Definition: eda_units.h:43
const std::string LegacyPcbFileExtension
const std::string KiCadPcbFileExtension
const std::string ProjectFileExtension
const std::string DesignRulesFileExtension
void ignore_unused(const T &)
Definition: ignore.h:24
PROJECT & Prj()
Definition: kicad.cpp:573
@ GAL_LAYER_ID_BITMASK_END
This is the end of the layers used for visibility bit masks in legacy board files.
Definition: layer_ids.h:226
@ UNDEFINED_LAYER
Definition: layer_ids.h:60
@ Rescue
Definition: layer_ids.h:133
#define GAL_LAYER_INDEX(x)
Use this macro to convert a GAL layer to a 0-indexed offset from LAYER_VIAS.
Definition: layer_ids.h:264
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
bool ImportSpecctraSES(wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
SETTINGS_MANAGER * GetSettingsManager()
bool WriteDRCReport(BOARD *aBoard, const wxString &aFileName, EDA_UNITS aUnits, bool aReportAllTrackErrors)
Run the DRC check on the given board and writes the results to a report file.
BOARD * CreateEmptyBoard()
Construct a default BOARD with a temporary (no filename) project.
wxArrayString GetFootprintLibraries()
Get the nicknames of all of the footprint libraries configured in pcbnew in both the project and glob...
FP_LIB_TABLE * GetFootprintLibraryTable()
int GetUserUnits()
Return the currently selected user unit value for the interface.
wxArrayString GetFootprints(const wxString &aNickName)
Get the names of all of the footprints available in a footprint library.
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
static PCB_EDIT_FRAME * s_PcbEditFrame
bool IsActionRunning()
Are we currently in an action plugin?
void UpdateUserInterface()
Update the layer manager and other widgets from the board setup (layer and items visibility,...
bool SaveBoard(wxString &aFileName, BOARD *aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings)
bool ExportSpecctraDSN(wxString &aFullFilename)
Will export the current BOARD to a specctra dsn file.
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
std::deque< BOARD_ITEM * > GetCurrentSelection()
Get the list of selected objects.
bool ExportVRML(const wxString &aFullFileName, double aMMtoWRMLunit, bool aExport3DFiles, bool aUseRelativePaths, const wxString &a3D_Subdir, double aXRef, double aYRef)
Export the current BOARD to a VRML (wrl) file.
static SETTINGS_MANAGER * s_SettingsManager
BOARD * GetBoard()
bool ExportFootprintsToLibrary(bool aStoreInNewLib, const wxString &aLibName, wxString *aLibPath)
Save footprints in a library:
PROJECT * GetDefaultProject()
BOARD * NewBoard(wxString &aFileName)
Creates a new board and project with the given filename (will overwrite existing files!...
BOARD * LoadBoard(wxString &aFileName)
SEVERITY
void ExportBoardToSpecctraFile(BOARD *aBoard, const wxString &aFullFilename)
Helper method to export board to DSN file.
std::vector< FAB_LAYER_COLOR > dummy
A filename or source description, a problem input line, a line number, a byte offset,...
Definition: ki_exception.h:119
Definition of file extensions used in Kicad.