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.
How to check if a part is hidden by the user?
david_riedell
Member Posts: 23 ✭✭
I've been searching the featurescript docs but I can't figure out how to tell if the user has hidden a part from the parts list.
I need something along the lines of:
if (part.isHidden()) {
// do something
}
How can you tell if the part is visible?
I need something along the lines of:
if (part.isHidden()) {
// do something
}
How can you tell if the part is visible?
0
Comments
But you can see what is hidden on the bottom of the tree.
@alnis is my personal account. @alnis_ptc is my official PTC account.
Short answer: No, you cannot find out whether a part is hidden in the feature.
Long answer: In order to do something like this, you can, in the editing logic function, use the hidden parts parameter, which will give you a query of the hidden parts. This can then be stored in the definition.
If you can tell us what you are wanting the condition for, we could provide a better solution.
IR for AS/NZS 1100
@MBartlett21
I wrote a featurescript a few months ago that will populate a custom table with the dimensions of each individual part in a part studio. The goal was to make efficient use of sheet goods like plywood by finding the smallest bounding box around a panel regardless of its shape or orientation to minimize waste when cutting the panel out of the plywood sheet.
I then thought that it might be nice if this featurescript would only operate on parts that are visible so that parts that are hidden by the user would be removed from the custom table.
Are you talking about the hiddenBodies query from this page? https://cad.onshape.com/FsDoc/uispec.html Right now I'm doing a query to grab qAllModifiableSolidBodies. Is there an elegant way to subtract the results of hiddenBodies from qAllModifiableSolidBodies?
I probably hide/show hundreds of times while modeling. Too volatile...
It would be best to use a selection scope.
Or make a delete part feature that you can suppress with a config.