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.
FeatureScript with sketches
jrs_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.
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.
0
Best Answer
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,212Sketch topology is a little weird -- it consists of one individual (not connected) wire body for each entity, and then, separately, zero or more sheet bodies for an imprint of the sketch. Try getting the vertex coordinates (evVertexPoint) and then using qContainsPoint restricted to the sketch topology (and try restricting with BodyType.WIRE and EntityType.EDGE).Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
var operationId = lastModifyingOperationId(context, myVertex);
var featureId = resize(operationId, size(operationId) - 1) as Id;