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.
change composite part color with FS?
EvanReese
Member, Mentor Posts: 3,059 PRO
I've tried setProperty() with the composite and it says only bodies and faces are allowed. I've tried qContainedInCompositeParts() to get the bodies inside of it, and it still doesn't do much. How do I change the color of a closed composite part?
0
Best Answer
-
Because of the way it's implemented, the composite body contains a vertex. I'd get just the composite body like so:
colorBodies = qCreatedBy(id + "compositePart1", EntityType.BODY);
0
Answers
-
Works for me: https://cad.onshape.com/documents/2d178e506b0d3ef4e5dea658/w/063bd30830e016da137ef7a9/e/cf342d2f178e97c04eed3625Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0
-
Does the query you're passing resolve to a body? This should be working.0
-
hmm, for some reason the way I was querying my composite part also queried a vertex, which was failing setProperty(). Here's how i'm getting the query:
colorBodies = qCreatedBy(id + "compositePart1");
I was able to get it working like this, but where did the vertex come from? The only inputs to the composite part were 4 solid bodies.colorBodies = evaluateQuery(context, colorBodies)[1];
0 -
Because of the way it's implemented, the composite body contains a vertex. I'd get just the composite body like so:
colorBodies = qCreatedBy(id + "compositePart1", EntityType.BODY);
0 -
I see. Thanks, thats a good solution.
0


