EgtInterface 1.6d6 :
- aggiunta EgtSaveObjToFile a API e Lua.
This commit is contained in:
+36
-1
@@ -400,7 +400,7 @@ EgtSaveFile( const string& sFilePath, int nFlag)
|
||||
int nCurrMachGroup = EgtGetCurrMachGroup() ;
|
||||
EgtResetCurrMachGroup() ;
|
||||
// salvo il file
|
||||
bool bOk = pGseCtx->m_pGeomDB->Save( sFilePath, nFlag) ;
|
||||
bool bOk = pGseCtx->m_pGeomDB->Save( GDB_ID_ROOT, sFilePath, nFlag) ;
|
||||
// eventuale ripristino precedente CAM
|
||||
if ( nCurrMachGroup != GDB_ID_NULL)
|
||||
EgtSetCurrMachGroup( nCurrMachGroup) ;
|
||||
@@ -420,3 +420,38 @@ EgtSaveFile( const string& sFilePath, int nFlag)
|
||||
// restituisco il risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSaveObjToFile( int nId, const wchar_t* wsFilePath, int nFlag)
|
||||
{
|
||||
return ( EgtSaveObjToFile( nId, wstrztoA( wsFilePath), nFlag) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
EgtSaveObjToFile( int nId, const string& sFilePath, int nFlag)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// se ero in CAM, esco
|
||||
int nCurrMachGroup = EgtGetCurrMachGroup() ;
|
||||
EgtResetCurrMachGroup() ;
|
||||
// copio l'oggetto nel file
|
||||
bool bOk = pGeomDB->Save( nId, sFilePath, nFlag) ;
|
||||
// ripristino eventuale precedente CAM
|
||||
if ( nCurrMachGroup != GDB_ID_NULL)
|
||||
EgtSetCurrMachGroup( nCurrMachGroup) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLuaPath = sFilePath ;
|
||||
ReplaceString( sLuaPath, "\\", "\\\\") ;
|
||||
string sLua = "EgtSaveObjToFile('" + sLuaPath + "'," +
|
||||
ToString( nId) + "," +
|
||||
NgeTypeToString( nFlag) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco il risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user