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.
Difference Between Make Robust Query and Set External Disambiguation
Alex_Kempen
Member Posts: 248 EDU
Hello,
Although I'm currently quite happy with the performance and behavior of my Plate FeatureScript, I need to make changes to it so that it behaves properly in the face of upstream changes. I'm aware I can use some combination of MakeRobustQuery, Unstable Component Ids, and SetExternalDisambiguation to accomplish this, as well as the new forEachEntity function (which uses setExternalDisambiguation and unstable id Components internally), but I'm unsure of how exactly I need to apply each in order to get the result I want.
Specifically, I'm having difficulty because the Plate FS utilizes geometry from a variety of user inputs to get to the final result, so it isn't clear what exactly I need to disambiguate, or what that disambiguation should point to. For example, the exterior geometry of the plate is taken from the outerGeometry query and then processed in the function getOuterGeometry, before the geometry is drawn in and connected together in the function extrudePlate. The function getOuterGeometry also utilizes information attached to some queries in the part studio to determine if the user has added motors or holes to certain geometry, which are extruded later on. However, I'm unsure of how exactly I can apply the necessary external disambiguation to the plate specifically - I assume I need to disambiguate either the sketch or the geometry drawn on it, but I'm unsure of how that would work since I'm working with a sketch with individual sketch components, rather than a feature operation I'm looping through. I'm also unsure of what effect MakeRobustQuery has on all of this, since the documentation isn't very clear on what it specifically does. Should I try to use MakeRobustQuery on all user input queries? Any help on this would be greatly appreciated.
Although I'm currently quite happy with the performance and behavior of my Plate FeatureScript, I need to make changes to it so that it behaves properly in the face of upstream changes. I'm aware I can use some combination of MakeRobustQuery, Unstable Component Ids, and SetExternalDisambiguation to accomplish this, as well as the new forEachEntity function (which uses setExternalDisambiguation and unstable id Components internally), but I'm unsure of how exactly I need to apply each in order to get the result I want.
Specifically, I'm having difficulty because the Plate FS utilizes geometry from a variety of user inputs to get to the final result, so it isn't clear what exactly I need to disambiguate, or what that disambiguation should point to. For example, the exterior geometry of the plate is taken from the outerGeometry query and then processed in the function getOuterGeometry, before the geometry is drawn in and connected together in the function extrudePlate. The function getOuterGeometry also utilizes information attached to some queries in the part studio to determine if the user has added motors or holes to certain geometry, which are extruded later on. However, I'm unsure of how exactly I can apply the necessary external disambiguation to the plate specifically - I assume I need to disambiguate either the sketch or the geometry drawn on it, but I'm unsure of how that would work since I'm working with a sketch with individual sketch components, rather than a feature operation I'm looping through. I'm also unsure of what effect MakeRobustQuery has on all of this, since the documentation isn't very clear on what it specifically does. Should I try to use MakeRobustQuery on all user input queries? Any help on this would be greatly appreciated.
CS Student at UT Dallas
Alex.Kempen@utdallas.edu
Check out my FeatureScripts here:
1
Comments
MakeRobustQuery and its variances are useful for keeping track of references within the feature. They are only needed if the feature might modify these references (e.g. perform opBoolean on the corresponding bodies). I don't think it is needed in case of plateFeatureScript. There references are used only to construct new bodies .
unstable id component + external disambiguation are used for stabilization of downstream references. e.g. plate feature is created, then a mate connector is set on one of the holes. If you edit the plate feature and remove some of the hole placements you don't want that mate connector to jump to another hole.
In motorMounting feature you are creating a sketch per motor location - this is a good candidate for use of forEachEntity function.
Okay, so I think the thing I'm unsure of at this point is how I can properly disambiguate the holes added through the hole tab. Basically the current method is a hole sketch is created on the plate plane, then each point defining a hole has an appropriately sized circle added to the sketch. Later on, the entire hole sketch is extruded and then subtracted from the plate all at once. Since this extrude is a single operation, and the creation of each circle representing each hole is a sketch operation, I'm not sure where exactly I can attach an unstable id component and run an external disambiguation. Do I need to break my hole extrudes out into individual extrudes or something?
Doing single opExtrude and single opBoolean actually gives you a better performance. Extruded bodies are fully disambiguated by sketch faces used for extrusion. It is sketches that require disambiguation, that why I'm proposing that you use forEachEntity in motorMounting
Holes added through the hole tab of the Plate FeatureScript are processed in the function getHoles and then extruded in the function extrudeHoles (extrudeHoles also extrudes any motors the user creates, as well as faces they choose to remove). Notably, this is different than the way motors are handled, since motors use the imported motorMounting FS, and holes do not. I think I understand how I can apply forEachEntity and/or setExternalDisambiguation to the motorMounting FS, but I'm still unsure of how I can apply those to the holes since they are handled differently. Would creating a sketch with an unstable id component for each hole, disambiguating each sketch individually, and then extruding all of the sketches at once result in proper behavior?
Thanks for the help!