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.
What is the `op` intended to convey in certain featurescript library?
kenn_sebesta167
Member Posts: 110 ✭✭
There are a whole class of features which are seemingly duplicated in intent, but not in functionality nor argument structure. extrude and opExtrude are a couple great examples:
- extrude: https://cad.onshape.com/FsDoc/library.html#module-extrude.fs
- opExtrude: https://cad.onshape.com/FsDoc/library.html#opExtrude-Context-Id-map
When I see features in the library with op in front, how should I think about them? They seem a teensy bit easier to use, but a lot less featureful. I see that op commands are listed in the geomOperations area, whereas the regular versions are in Features, but this seems like a weak distinction to draw too many conclusions from.
Is the one somehow a wrapper for the other? If so, is there a way to embed the arguments for one into the other?
Comments
I believe op is short for "operation" (ev is short for evaluate)
extrude is the user facing feature. This is literally the standard feature that shows up in the tool bar.
A feature is just a function, so features can call other features. There is nothing stopping you from calling the standard extrude from your feature - and in some corner cases (like sheet metal) its the better option.
opExtrude is the base level call to modify the context, its as low as your featurescript gets before things get sent to the black box that is the back end of Onshape. While opExtrude is missing some functionality of extrude - that missing code also means its going to be a bit more efficient. Standard features have a lot of quality of life meant for users that your FeatureScript might not need. A simple feature might not be noticeable, but when you get to more complex features, the regen time of your code can quickly add up.
There exist op functions that don't have a full feature counterpart, and some full features don't have a base level operation.
Custom FeatureScript and Onshape Integrated Applications
Yep. The idea is to have a set of orthogonal primitives. E.g.,
extrudeperforms anopExtrude, possibly with anopBooleanand anopDraft.