Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

feature script code from view code

abdallah_mashalyabdallah_mashaly Member Posts: 4

I have a design and i use this to get its features:

feature_url = '/api/partstudios/d/' + did + '/w/' + wid + '/e/' + eid + '/features'   

feature_response = self._api.request('get', feature_url)

the problem is in the revolve feature this is the only information i get about the axis

{u'message': {u'hasUserCode': False

u'nodeId': u'31IcQ62NC2iMQ1x/'

u'parameterId': u'axis'

u'queries': [{u'message': {u'geometryIds': [u'JFB']

u'hasUserCode': False

u'nodeId': u'FjCDPQl76cEw8kI'}

u'type': 138

u'typeName': u'BTMIndividualQuery'}]}

u'type': 148

u'typeName': u'BTMParameterQueryList'}

i get the geometry id is JFB,
but when i check the sketch feature i find no entity with that id

so when look in the view code section from the viewer i find this:
var gqjatkDKRfynOL_query;
gqjatkDKRfynOL_query=qCompressed(1.0,"%B5$QueryM5Sa$entityTypeBa$EntityTypeS4$EDGESb$historyTypeS8$CREATIONSb$operationIdB2$IdA1S11.6$FXjvWm5Hqp3D6Ak_1wireOpS9$queryTypeSd$SKETCH_ENTITYSe$sketchEntityIdSc$miD53jbgEup3",id);
var lBQgwXAEEjDTse_query;
lBQgwXAEEjDTse_query=qCompressed(1.0,"&1bf$eJx1kMtugzAQRX/G3VY807AE4xAn4WW7asgGGbDAbQIUSCL69YUgdVNlOTNn7tw7L44J4qvoRt+kqgYK2fNLJssrH2RTu3zgtupr/ydsbAVVdRAS7OHAPqQuilDgogAm1AJNJ0tZ83NvG1CZhDkQ9SCHcd5yOEB/BTUAcj1EM1DJfmi6pbkGkCCb4TCYBk0rusdJXDgawIWtUlV9XYFNCT+PpbPrdcEp71LlLjsRttP17znOQ6gAdI8Y3KYoYJglVID+Swx5tRjABc0Bzc+a8rPz/CODs1diEJOsyBtZE04ykpMZwlqw6Q/vjm4l9VNIP1X3eDtu7WifP4WYElvV6HFiuhEx4Gp6gBO6ycLBbAlngY3J3N0FGZl/OTXxLVWalohbc74Jkk3fpB8oYum8+Asz0ZBN",id);
annotation { "Feature Name" : "Revolve 2" }
revolve(context, id + "FOnX1poAa6gstog_1", { "bodyType" : ToolBodyType.SOLID, "operationType" : NewBodyOperationType.REMOVE, "surfaceOperationType" : NewSurfaceOperationType.NEW, "entities" : qUnion([sGbPJfegkyLLsb_query]), "surfaceEntities" : qUnion([]), "axis" : qUnion([gqjatkDKRfynOL_query]), "revolveType" : RevolveType.FULL, "oppositeDirection" : true, "angle" : { 'value' : try(30 * degree), 'expression' : "30 deg" }.value, "angleBack" : { 'value' : try(330 * degree), 'expression' : "330 deg" }.value, "defaultScope" : false, "booleanScope" : qUnion([lBQgwXAEEjDTse_query]), "defaultSurfaceScope" : true, "booleanSurfaceScope" : qUnion([]), "asVersion" : FeatureScriptVersionNumber.V1675_VERSION_BUMP_FOR_COMPUTED_PROPERTIES_DOC });

from this we can extract that the entity id is miD53jbgEup3

is there anyway we could get this information via the api?

is there anywat we could get the same featurescript from the viewer from the api?

thanks

Sign In or Register to comment.