another function question
papawo
Member, Developers Posts: 206 PRO
lets say a feature that gives 'data' whatever the user pick
line & line = data
plane = data
how to do an export function to get 'data' usable to other fs?
line & line = data
plane = data
how to do an export function to get 'data' usable to other fs?
Tagged:
0
Answers
-
if you mean that function should evaluate some query of unknown type and do some action with it then use the sequence of try silent {} operators
function evQuery(context is Context, query is Query)
{
var result;
try silent {
result = evLine();
debug(context, result);
return result;
}
try silent {
result = evPlane();
debug(context, result);
return result;
}
//and so on
}
0 -
the whole feature does the evaluating already. and I would like to capture the result to be exported.
when trying to do a function, I ending up repeating the code of the feature.0 -
then simply assign desired results of feature evaluation to the variable or append to array and do debug() or print() in the end
0 -
it does println or debug.
how to do the variable or append?0 -
ok, now i noticed your edited question.
there are 2 ways to make data global:
- setVariable() function creates global variable of any type (even function type) and this value can be obtained in later added features by getVariable()
- setAttributes()/getAttributes() sets and gets attributes of any type to a certain geometry, which can later be extracted by other features
0
