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.

FeatureScript with sketches

jrs_spedleyjrs_spedley Member Posts: 71 ✭✭
Can I just confirm that you can't access geometry in a sketch with featurescript?

I have a vertex selected from a sketch as a parameter and I'd like to query all the edges in a sketch connected to that vertex.  I've spent about 2 hours trying and I've come to the conclusion it isn't possible.

Best Answer


  • jrs_spedleyjrs_spedley Member Posts: 71 ✭✭
    Thanks for your help but I've now spent 45 minutes trying to figure out how find the sketch id of the sketch which contains the vertex I pass as a parameter.  Not sure what is wrong with "vertex.parent" or something like that :) 
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 980
    You can use https://cad.onshape.com/FsDoc/library.html#lastModifyingOperationId-Context-Query except you'll have to strip out the last part of the id -- so something like:
    var operationId = lastModifyingOperationId(context, myVertex);
    var featureId = resize(operationId, size(operationId) - 1) as Id;
    Ilya Baran \ Director, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.