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 do I highlight a failing edge with opFillet like the native fillet feature?
EvanReese
Member, Mentor Posts: 2,135 ✭✭✭✭✭
When using the fillet feature, it highlights at least one problematic edge when the feature fails. How do get this behavior from a custom feature calling opFillet?
I've dug around the Standard Library Source looking for how it's done, but to be honest, I don't understand how it is all interconnected. Can someone point me in the right direction?
I've dug around the Standard Library Source looking for how it's done, but to be honest, I don't understand how it is all interconnected. Can someone point me in the right direction?
Evan Reese
0
Best Answers
-
NeilCooke Moderator, Onshape Employees Posts: 5,686I'm wrong again (I'm just flailing around in the dark here, literally) - it is the feature id - if the feature uses the top-level id of the custom feature then it works so:
opFillet(context, id, { "entities" : finalQuery, "radius" : definition.radius });
works, butopFillet(context, id + "fillet1", { "entities" : finalQuery, "radius" : definition.radius });
does not. So as long as the result of your feature is this one opFillet, then you can use the top-level id. If not, who knows.
Interestingly, setErrorEntities also only seems to work with the top-level id.Senior Director, Technical Services, EMEAI5 -
Jake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646@Evan_Reese
@NeilCooke asked me to shed some light on this. Basically, error entities are attached to an id. If you want error entities to show up, they have to be attached to the top-level feature id. We do not automatically migrate subfeature/suboperation error entities to the top level feature because that is not always the desired outcome. Imagine, for instance, calling a Boolean operation in your feature, and, if it fails, catching that failure and instead trying to do that boolean in smaller batches (this is how fix pcb works). You would not want the error entities from the initial boolean to come through, because that did not cause a feature failure.
The appropriate way to bootstrap error entities from a subfeature to the feature itself is as follows:try
Or to just pass the top level id directly into the fillet (but, this can only be done for one subfeature, since ids passed into subfeatures must be unique)
{
opFillet(context, subId, ...);
}
catch (error)
{
processSubfeatureStatus(context, topLevelId, { "subfeatureId" : subId, "propagateErrorDisplay" : true });
throw error;
}
To get the nice code box you can click on this button:
and then paste the code from your feature studio into the empty box that shows up.Jake Rosenfeld - Modeling Team5
Answers
Please take a look at the documentation for setErrorEntities (https://cad.onshape.com/FsDoc/library.html#setErrorEntities-Context-Id-map).
(how do I format the code better?)
@jakeramsley
that sounds like what I need, but I'm too novice to know what to do with it just based on the link you sent.
works, but
does not. So as long as the result of your feature is this one opFillet, then you can use the top-level id. If not, who knows.
Interestingly, setErrorEntities also only seems to work with the top-level id.
That did the trick! Thanks!
I'm not sure what I've learned here other than "ask the forums next time I'm stuck." If someone who knows how this works feels like writing any kind of explanation, long or short, I promise to read it and try to understand. Otherwise, I'll just be on my way to get this feature ready enough to share.
@NeilCooke asked me to shed some light on this. Basically, error entities are attached to an id. If you want error entities to show up, they have to be attached to the top-level feature id. We do not automatically migrate subfeature/suboperation error entities to the top level feature because that is not always the desired outcome. Imagine, for instance, calling a Boolean operation in your feature, and, if it fails, catching that failure and instead trying to do that boolean in smaller batches (this is how fix pcb works). You would not want the error entities from the initial boolean to come through, because that did not cause a feature failure.
The appropriate way to bootstrap error entities from a subfeature to the feature itself is as follows:
Or to just pass the top level id directly into the fillet (but, this can only be done for one subfeature, since ids passed into subfeatures must be unique)
To get the nice code box you can click on this button:
and then paste the code from your feature studio into the empty box that shows up.