Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
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
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
}
when trying to do a function, I ending up repeating the code of the feature.
how to do the variable or append?
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