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.
Retrieve extruded sketch from OnShape API by GeoID
elias_berger506
Member Posts: 4 ✭
Hello,
Im trying to export all Sketch and Extrude Operations of a CAD Model via API for downstream processing. Ultimately I want to create a datastructure similar to this:
I can retrieve the edges and constraints using the endpoint /partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/features. No problem here. But for extrude operations I receive
Im trying to export all Sketch and Extrude Operations of a CAD Model via API for downstream processing. Ultimately I want to create a datastructure similar to this:
I can retrieve the edges and constraints using the endpoint /partstudios/d/{did}/{wvm}/{wvmid}/e/{eid}/features. No problem here. But for extrude operations I receive
{
"type" : 148,
"typeName" : "BTMParameterQueryList",
"message" : {
"queries" : [ {
"type" : 138,
"typeName" : "BTMIndividualQuery",
"message" : {
"geometryIds" : [ "JGC" ],
"hasUserCode" : false,
"nodeId" : "Fw7bheyuFAclyzY"
}
} ],
"parameterId" : "entities",
"hasUserCode" : false,
"nodeId" : "YwtNXy9HOwP0MsqL"
}
Now I don't know how I can resolve the geometryId "JGC" into a sketch entity, because I need to know which sketch is extruded. Is there any featurescript function or API call do resolve this?
Now I don't know how I can resolve the geometryId "JGC" into a sketch entity, because I need to know which sketch is extruded. Is there any featurescript function or API call do resolve this?
Any help is greatly appreciated!
0
Answers
Last modifying operator is the closest you'll get from an entity id.
The other option is to go through the feature tree and at each point in the feature tree (ie do an evaluateFeaturescript with rollback index set), get qcreatedby and evaluate it to get everything createdd by each feature and cross reference to the input ids. Bit more brute force, but might be useful for your data model.
Custom FeatureScript and Onshape Integrated Applications