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 query an object after a boolean union?
monroe_weber_shirk
Member Posts: 96 EDU
I'm creating a feature that allows me to extend multiple walls up to a target height.
I see the advice to use startTracking and I've tried that, but no luck.
What am I missing?
Below is my code snippet and a link to the FeatureScript
- Select the top face of a wall element.
- opExtrude a calculated distance to create a new wall element.
- opBoolean union to join the two parts
- I need to select the part created with the opBoolean to modify its attributes.
I see the advice to use startTracking and I've tried that, but no luck.
What am I missing?
Below is my code snippet and a link to the FeatureScript
opExtrude(context, id + "extrude1", {
"entities" : entity,
"direction" : myMate.zAxis,
"endBound" : BoundingType.BLIND,
"endDepth" : extendedH,
});
const partsToBoolean = qUnion(qOriginalPart, qCreatedBy(id + "extrude1", EntityType.BODY));
var mergedPart = startTracking(context, partsToBoolean);
opBoolean(context, id + "boolean1", {
"tools" : partsToBoolean,
"operationType" : BooleanOperationType.UNION
});
debug(context, mergedPart, DebugColor.GREEN);
Tagged:
0
Best Answers
-
MichaelPascoe Member Posts: 1,982 PRO
Have you tried makeRobustQuery() ?
Something like this perhaps:var partsToBoolean = qUnion(qOriginalPart, qCreatedBy(id + "extrude1", EntityType.BODY)); partsToBoolean = makeRobustQuery(context, partsToBoolean); opBoolean(context, id + "boolean1", { "tools" : partsToBoolean, "operationType" : BooleanOperationType.UNION }); debug(context, partsToBoolean, DebugColor.GREEN);
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴0 -
MichaelPascoe Member Posts: 1,982 PRO
Here are the steps I take:- Select the code in FS and copy.
- Within the forum post, select the paragraph format "code".
- Paste the code into the code formatted area.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴0
Answers
Have you tried makeRobustQuery() ?
Something like this perhaps:
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Here are the steps I take:
- Select the code in FS and copy.
- Within the forum post, select the paragraph format "code".
- Paste the code into the code formatted area.
It's very picky. If you mess the steps up, sometimes it corrupts the format and you have to delete everything and try again.Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴