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.
Evaluate FeatureScript request returns empty BTFSValueArray instead of face.
max_borsh
Member, Developers Posts: 14 ✭
Hi everybody!
I want to determine the geometryId for existing face (upper face of extrude).
I have featureId of extrude that I got from response (feature -> message -> featureId. "FjEqUFlhNuPViCq_0", for example)
I sent evaluating FeatureScript request like this:
P.S.: documentID, workspaceID, elementID, serializationVersion, sourceMicroversion were added with evaluate FS request.
Thank you in advice!
I want to determine the geometryId for existing face (upper face of extrude).
I have featureId of extrude that I got from response (feature -> message -> featureId. "FjEqUFlhNuPViCq_0", for example)
I sent evaluating FeatureScript request like this:
"FjEqUFlhNuPViCq_0", false), EntityType.FACE))); }
function(context is Context, queries){ return transientQueriesToStrings(evaluateQuery(context,
qEntityFilter(qCapEntity(newId() + but in response I have only empty BTFSValueArray. What am I doing wrong?P.S.: documentID, workspaceID, elementID, serializationVersion, sourceMicroversion were added with evaluate FS request.
Thank you in advice!
0
Comments
Okay, I did it.
I created a custom feature with this call after the extrude feature via API was created. And I see the face that I need through debug. I can even get the transientId by using transientQueriesToStrings and println:
But If I use same request via API (using C# HttpClient) it returns nothing (json that doesn't contain notices(errors) but contains empty BTFSValueArray).
Another requests I sent (determine geometry of front plane, create sketch etc) worked fine.
planeDetermination = await SendObjectAsJsonAsync<object>( String.Format(OnshapeAPIConstants.FEATURES_FEATURE_SCRIPT, documentID, workspaceID, elementID), new OnshapeFeatureScriptEvaluationRequest() { script = "function(context is Context, queries){ return transientQueriesToStrings(evaluateQuery(context, qCreatedBy(makeId(\"Front\"), EntityType.FACE)));}", serializationVersion = serializationVersion, sourceMicroversion = sourceMicroversion, queries = new object[0] });Doesn't work:planeDetermination = await SendObjectAsJsonAsync<object>( String.Format(OnshapeAPIConstants.FEATURES_FEATURE_SCRIPT, documentID, workspaceID, elementID), new OnshapeFeatureScriptEvaluationRequest() { script = "function(context is Context, queries){{ return transientQueriesToStrings(evaluateQuery(context, qEntityFilter(qCapEntity(newId() + \"FBdS264Dn0b9qW0_0\", false), EntityType.FACE)));}}", serializationVersion = serializationVersion, sourceMicroversion = sourceMicroversion, queries = new object[0] });Thank you in advise!If you remove the sourceMicroversion field from your request, you will probably find this does what you expect.
It's exactly what I need!