Hi
I do not have first-hand experience with the C++ API, but in Python it could perhaps look something like this:
import fmeobjects
encoded_text = '@EvaluateExpression(FDIV,STRING,<at>Value<openparen>mypath<closeparen>,MyModule)'
decoded_text = fmeobjects.FMESession().decodeFromFMEParsableText(encoded_text)
mypath = my_feature.performFunction(decoded_text)
It seems that the method decodeFromFMEParsableText() is located in IFMEString in the C++ libraries, however.
Hope this gives you some ideas.
David
Thanks a lot david!!!! It works for me.
My plugin is a mixed CLI/C++ DLL, the code ....
// Expand expressions of Keywords ?
for each (String^ key in gcnew List<String^>(static_cast<IDictionary<String^,String^>^>(_keywords)->Keys))
{
String^ value = _keywords->default[key];
if (value->Contains("@"))
{
std::string tempString = msclr::interop::marshal_as<std::string>( value );
IFMEString* v = _fmeSession->createString();
IFMEString* r = _fmeSession->createString();
*v = tempString.c_str();
v->decodeFromFMEParsableText();
FME_MsgNum rs = feature->performFunction(*v, *r);
if (rs==FME_SUCCESS)
{
_keywords->default[key] = gcnew String(r->data());
}
_fmeSession->destroyString(v);
_fmeSession->destroyString(r);
}
}
Alvaro
Thanks a lot david!!!! It works for me.
My plugin is a mixed CLI/C++ DLL, the code ....
// Expand expressions of Keywords ?
for each (String^ key in gcnew List<String^>(static_cast<IDictionary<String^,String^>^>(_keywords)->Keys))
{
String^ value = _keywords->default[key];
if (value->Contains("@"))
{
std::string tempString = msclr::interop::marshal_as<std::string>( value );
IFMEString* v = _fmeSession->createString();
IFMEString* r = _fmeSession->createString();
*v = tempString.c_str();
v->decodeFromFMEParsableText();
FME_MsgNum rs = feature->performFunction(*v, *r);
if (rs==FME_SUCCESS)
{
_keywords->default[key] = gcnew String(r->data());
}
_fmeSession->destroyString(v);
_fmeSession->destroyString(r);
}
}
Alvaro
Glad to hear you found a solution! Thanks for posting the working code as well.