diff --git a/EXE_GeoSnap.cpp b/EXE_GeoSnap.cpp index f8d428e..5562352 100644 --- a/EXE_GeoSnap.cpp +++ b/EXE_GeoSnap.cpp @@ -31,6 +31,9 @@ #include "/EgtDev/Include/EgkDistPointCurve.h" #include "/EgtDev/Include/EgkIntersCurves.h" #include "/EgtDev/Include/EgtPointerOwner.h" +#include + +using namespace std ; //---------------------------------------------------------------------------- bool @@ -1084,6 +1087,20 @@ ExeTextNormVersor( int nId, int nRefId, Vector3d& vtNorm) return TrasformVector( pGeomDB, nId, nRefId, vtNorm) ; } +//---------------------------------------------------------------------------- +bool +ExeTextGetContent( int nId, string& sText) +{ + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero il testo + const IExtText* pTxt = GetExtText( pGeomDB->GetGeoObj( nId)) ; + if ( pTxt == nullptr) + return false ; + // recupero il contenuto + sText = pTxt->GetText() ; + return true ; +} //------------------------------------------------------------------------------- // Geo Transforms diff --git a/LUA_General.cpp b/LUA_General.cpp index 42d2427..9480882 100644 --- a/LUA_General.cpp +++ b/LUA_General.cpp @@ -150,8 +150,14 @@ LuaSplitString( lua_State* L) bool bFound = LuaGetParam( L, 1, sVal) ; LuaGetParam( L, 2, sSep) ; LuaClearStack( L) ; - // se ricevuta stringa, la divido in parti separate da ',' + // se ricevuta stringa, la divido in parti separate da sSep if ( bFound) { + // se tra i separatori c'é ' ', collasso gli spazi consecutivi in uno solo + if ( sSep.find( " ") != string::npos) { + while ( ReplaceString( sVal, " ", " ") > 0) + ; + } + // eseguo separazione STRVECTOR vsVal ; Tokenize( sVal, sSep, vsVal) ; // ritorno il risultato