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.
API Sketch Geometry ID
Lucas_Crupi
Member Posts: 5 EDU
When calling the /partsudios/d/{did}/{wvm}/{wvmid}/e/{eid}/features from the REST API, there are some geometry references in the form of three characters, eg. "geometryIds": ["JMF"]
I have been able to find the ID of edges using /partsudios/d/{did}/{wvm}/{wvmid}/e/{eid}/bodydetails however, when the referenced geometry is an entity within a sketch such as a line, I cannot seem to find the appropriate API call.
Any help or resources are greatly appreciated.
I have been able to find the ID of edges using /partsudios/d/{did}/{wvm}/{wvmid}/e/{eid}/bodydetails however, when the referenced geometry is an entity within a sketch such as a line, I cannot seem to find the appropriate API call.
Any help or resources are greatly appreciated.
0
Best Answer
-
alan_baljeu Member, User Group Leader Posts: 111 ✭✭The documentation has the resolution, thought it's a bit weird:
Feature List API | Onshape Developer Documentation (onshape-public.github.io)
We ask Onshape to run a featurescript query, get the geometry ID as a result, and that there is your geometryId.
Creating knowledge-driven design automation software, for molds, etc.
www.virtualmold.com-1
Answers
www.virtualmold.com
{
and the arc (or face?) JGC is defined in the program by sketch entity "pUzfMw2i2Kly", but there's nowhere in the API to identify this link.
But if I construct an extrude using a body face as reference, that reference can be found in the bodydetails call.
www.virtualmold.com
Feature List API | Onshape Developer Documentation (onshape-public.github.io)
We ask Onshape to run a featurescript query, get the geometry ID as a result, and that there is your geometryId.
www.virtualmold.com
The script that returned the "part of the sketch":
"script":"function(context is Context, queries){return transientQueriesToStrings(evaluateQuery(context, qCreatedBy(makeId('Fd5TnWYq9UpUQe5_0'), EntityType.BODY)));}"
I know this as I tried to use the returned geometryID as a revolute axis:
Then I tried specifying, GeometryType.LINE, and got an empty return value, the script:
"script":"function(context is Context, queries){return transientQueriesToStrings(evaluateQuery(context, qGeometry(qCreatedBy(makeId('Fd5TnWYq9UpUQe5_0'), EntityType.BODY),GeometryType.LINE)));}"
Which returned: