API: Add symbol path for footprint instances

See https://gitlab.com/kicad/code/kicad-python/-/issues/37
This commit is contained in:
Jon Evans
2025-04-26 09:52:42 -04:00
parent e626799d67
commit 4dd39976a3
4 changed files with 20 additions and 0 deletions
+11
View File
@@ -21,6 +21,7 @@
#include <magic_enum.hpp>
#include <api/api_utils.h>
#include <geometry/shape_poly_set.h>
#include <kiid.h>
#include <wx/log.h>
const wxChar* const traceApi = wxT( "KICAD_API" );
@@ -232,4 +233,14 @@ KICOMMON_API KIGFX::COLOR4D UnpackColor( const types::Color& aInput )
return KIGFX::COLOR4D( r, g, b, a );
}
KICOMMON_API void PackSheetPath( types::SheetPath& aOutput, const KIID_PATH& aInput )
{
aOutput.clear_path();
for( const KIID& entry : aInput )
aOutput.add_path()->set_value( entry.AsStdString() );
aOutput.set_path_human_readable( aInput.AsString().ToStdString() );
}
} // namespace kiapi::common