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.
order of iteration For loop for FACE query
theodore_peters
Member Posts: 15 ✭
I have seen the path method for getting the correct order of edges, is there a way i can do it for faces as well?
It creates the stairs, but as you know, it will not iterate thorugh the query in any specific order.
Any suggestions?
It creates the stairs, but as you know, it will not iterate thorugh the query in any specific order.
Any suggestions?
<div> var allfaces is Query = qEverything(EntityType.FACE);</div><br><div> var allfaces1 is Query = qCreatedBy(id + "mainsketch", EntityType.FACE);</div><br><div> </div><br><div> var count =0;</div><br><div> var evallfaces = evaluateQuery(context, allfaces1);</div><br><div> for (var faces in evallfaces)</div><br><div> {</div><br><div> count+=1;</div><br><div> opExtrude(context, id + ("extrude1"~toString(count)), {</div><br><div> "entities" : faces,</div><br><div> "direction" : vector(0,0,1),</div><br><div> "endBound" : BoundingType.BLIND,</div><br><div> "endDepth" : count*definition.rise</div><br><div> });</div><br><div> }</div>
0
Comments
(Looking again, if you're finding sketch regions, those aren't associated with individual ids, so your solution is likely the best one)
the reverse is true for direction vectors, if your vector is a length vector make sure you divide by a unit