Fully expand all text variables in 3d output

We were doing half of the job but we need to get the board variables as
well

Fixes https://gitlab.com/kicad/code/kicad/issues/17768
This commit is contained in:
Seth Hillbrand 2024-04-18 02:57:39 +02:00
parent f088b0d18a
commit 79166510e9
1 changed files with 9 additions and 0 deletions

View File

@ -361,7 +361,16 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
wxString path = m_outputFileName->GetValue();
m_parent->SetLastPath( LAST_PATH_STEP, path );
// Build the absolute path of current output directory to preselect it in the file browser.
std::function<bool( wxString* )> textResolver =
[&]( wxString* token ) -> bool
{
return m_parent->GetBoard()->ResolveTextVar( token, 0 );
};
path = ExpandTextVars( path, &textResolver );
path = ExpandEnvVarSubstitutions( path, &Prj() );
path = Prj().AbsolutePath( path );
if( path.IsEmpty() )
{