Get remaining part after opBoolean union
This seems like it should be trivial, but I'm stumped: When I perform an opBoolean to merge a set of parts together into a single part, I can't figure out how to directly query the resulting part. As a work around, I use qNthElement to extract the first part out of the tools query prior to executing opBoolean, as that part is the resulting part. This works, but it seems very hacky. Any better ideas?
Here's a code excerpt demonstrating what I'm asking:
qParts = qUnion(qParts1, qParts2);
// Get the first element from qParts, as it will be the part into which opBoolean merges all the other parts
qfinalPart = qNthElement(qBaseParts, 0);
opBoolean(context, id + "boolean1", {
"tools" : qBaseParts,
"operationType" : BooleanOperationType.UNION
});
setProperty(context, {
"entities" : qFinalPart,
"propertyType" : PropertyType.NAME,
"value" : "Final Part"
});
In short: How do I determine qFinalPart from the opBoolean operation rather than having to infer it in advance using qNthElement?
Comments
-
For Union it is always the first part, so you could just use qParts1 ?
Senior Director, Technical Services, EMEA0 -
Ya, that's a little syntactically easier. I guess I'm surprised that you can't get the unified part from opBoolean itself.
0 -
If the first part was created by an extrude I usually use qCreatedBy(id + "extrude", EntityType.BODY)
Senior Director, Technical Services, EMEA0

