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.
FS entity query
graham_lock
Member Posts: 148 PRO
Hi all,
If I have a list of faces as a query and then use for ( var face in faces), how do ai pass face to a function that needs a query for its entities such as extrude?
Thank you.
If I have a list of faces as a query and then use for ( var face in faces), how do ai pass face to a function that needs a query for its entities such as extrude?
Thank you.
0
Best Answer
-
Caden_Armstrong Member Posts: 180 PROTypically you do not need to iterate through a query.
A query isnt really a list, its more of a set of instructions describing what to do an operation on.
So for an extrude, your "faces" query can just be passed in directly, and the query is evaluated at runtime.
If for some reason you do need to iterate through a query, you need to do an evaluateQuery on it first.
If you havent already, check out the learning centre course on featurescript. Theres a section on queries.
https://learn.onshape.com/courses/featurescript-fundamentals
www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications0
Answers
A query isnt really a list, its more of a set of instructions describing what to do an operation on.
So for an extrude, your "faces" query can just be passed in directly, and the query is evaluated at runtime.
If for some reason you do need to iterate through a query, you need to do an evaluateQuery on it first.
If you havent already, check out the learning centre course on featurescript. Theres a section on queries.
https://learn.onshape.com/courses/featurescript-fundamentals
Custom FeatureScript and Onshape Integrated Applications