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.
SET COLOUR, MASS, AND CUSTOM PROPERTY OF GEOMETRY CREATED BY FEATURE IN ONE GO
shawn_crocker
Member, OS Professional Posts: 865 PRO
I have modified the standard sheet metal model feature to be more straight forward for me. If I select a particular material in my custom sheet metal feature, at the moment it sets the thickness, inner rad and kfactor to the appropriate values. Would be create if it also could set the colour, mass and assign a string to a material custom property. Is there a way to have a feature assign properties to bodies it is creating at the same time?
Tagged:
0
Best Answer
-
konstantin_shiriazdanov Member Posts: 1,221 ✭✭✭✭✭Yes, if the operation expecting to get body to assign property to, that means you need to feed it a query which resolves to a body. id is Id in the function declaration means that on the second argument this function expecting to get a value of Id type and use it in the function body as variable named "id"
1
Answers
Thanks again. I'm not sure though, how to reference the bodies that are being created by the feature.
That makes sense. There is an "id is Id" defined in the opening feature function. So I would use "qCreatedBy(id, EntityType.BODY)." directly inside of the function that is attempting to set a custom property?
@NeilCooke
So I have managed to set things up working. Mass, colour and a custom property that holds a material callout and a raw material code, all get updated during the creation of the sheet metal feature. My problem has become that the custom properties go blank after I perform additional operations on the part like chamfer or put a hole through a face. Is there a way to stop this from happening? I notice the beam feature does not suffer from this so I'm wondering if it is just a sheet metal symptom.
Here is the public document. CUSTOM SHEET METAL FEATURES | Part Studio 1 (onshape.com). I set the custom property to update the standard description property that everyone has just so you can see what's happening.
Thanks for the help. It seems like the body being active, other features keep resetting it. Must be something in the background doing some work on the body in extra to the feature being used to grantee the sheet metal remains un-foldable. This is what I'm imagining with absolutely nothing concrete to base it on. Does @NeilCooke has any ideas? I probably will try to accomplish this same thing but by modifying the finish sheet metal feature. I want to include a flat pattern bounding box calculation anyways so the finish command may be the best place for all this to happen in one go.
Edit:
I'm surprised this is an issue. I'm surprised people have not attempted do add these types of user friendly abilities to sheet metal before and already reported it. It's kind of standard everywhere that you can setup predetermined values for your sheet metal and just select one.