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.
Hiding a sketch
sören_svensson
Member Posts: 21 ✭✭
Hi,
Does anyone know how to hide a sketch so it doesn't show up on screen?
I create a sketch in FS and revolve it, but in the UI, both the revolved body and the sketch are visible.
I've tried the UIHint.ALWAYS_HIDDEN but no luck.
Regards
Soren
Does anyone know how to hide a sketch so it doesn't show up on screen?
I create a sketch in FS and revolve it, but in the UI, both the revolved body and the sketch are visible.
I've tried the UIHint.ALWAYS_HIDDEN but no luck.
Regards
Soren
Tagged:
0
Best Answers
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211Hi,
The ALWAYS_HIDDEN hint is for the parameters, not the geometry produced by the features. You have two options. If you never want to see the sketch, within the feature, once you're done revolving the sketch, you can callopDeleteBodies(context, id + "deleteBodies", { "entities" : qCreatedBy(id + "yourSketchId") });
The other option, if you want to hide the sketch temporarily is to just click the eye icon that appears next to your custom feature in the feature list when you hover over it.
Hope this helps.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5 -
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211The answers to your questions are tied together. When you delete a sketch from the feature list in the UI, you are removing it from the regeneration "recipe", as if it was never there. But when you call opDeleteBodies, you are *adding* a new operation to the regeneration (in this case, inside your feature), after the sketch has already been used. That's why it needs a new id -- because it's a new operation. It's like the difference between removing the feature that creates a part and using the "Delete Part" feature (next to the Transform feature in the toolbar).Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
The ALWAYS_HIDDEN hint is for the parameters, not the geometry produced by the features. You have two options. If you never want to see the sketch, within the feature, once you're done revolving the sketch, you can call
The other option, if you want to hide the sketch temporarily is to just click the eye icon that appears next to your custom feature in the feature list when you hover over it.
Hope this helps.
opDeleteBodies did the trick.
two things I don't get with that function
1) why does it need a new id (id + "deleteBodies")?
2) in the UI, if I delete a sketch, bodies based on it disappear too, but not here (from FS), how come?
Regards
Soren
Maybe this is what you was looking for.
Regards
Stephan
That won't work if you want to use the sketch for creating solid geometry in the context you actually care about -- if you make such a sketch, you have no way of making e.g. an extrusion based on it that you end up seeing (unless you merge the contexts, in which case you also get the sketch).