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: 937 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
FRC Design Mentor - Team 1306 BadgerBots
Thanks again. I'm not sure though, how to reference the bodies that are being created by the feature.
FRC Design Mentor - Team 1306 BadgerBots
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.
@shawn_crocker
The link for CUSTOM SHEET METAL FEATURES | Part Studio 1 (onshape.com). is broken, I have been trying to work out adding a function to insert a Kfactor based on material and would be interested in seeing how you solved that problem.
@mitchell_braun924 Here is a new link. https://trebormanufacturing.onshape.com/documents/7cb3a2aaddb5ef9738251ee3/w/a227091b7cf37b893b5234a4/e/3aa2a86ddc6fe0731bb619c9
I have revamped that feature I think since that link was posted and the studio id must have changed. The feature is an edited standard feature. I have commented out portions of the standard feature that I either didn't need or needed to override to try and maintain the context of the standard feature. There are a few feature studios in there that work together. One of them is a modified finish feature. The finish feature applies properties to the sheet metal parts. The finish feature provides an option to apply to all sheet metal parts regardless of which parent sheet metal feature created the parts. I messed up a bit and I have noticed sometimes the option will apply properties to parts in the studio that are not actually active sheet metal parts. I haven't taken the time yet to add in a more robust filter method for that feature function. 😁
@shawn_crocker
Thanks for sharing! My goal has been to edit the sheet metal model feature (Assign kfactor based off thickness & material / assign material and other quality of life features), but it has been eluding me to this point.
Yes. As soon as I started into Onshape, the sheet metal feature immediately jumped out at me as "needing work". You will see in the feature there is a cvs import and the values in that gets mapped to an enum selection in the feature. I have always been extremely disappointed that enums cannot be generated from an external source. Its annoying to have to manually change the enum list in the feature every time a new material is added into the csv. I would lve to be able to mod the feature to accept a csv file as a feature input and have the enum list update according to what's in the csv. Maybe some day…. 🤔
@shawn_crocker
It would help a lot in compartmentalizing information. The one that really annoyed me when I started on this project was the inability of Featurescript to interact with the material library, I went and made a material library only to find out it will be somewhat redundant with any set property I put in.
How do you have the FeatureList / the imported table csv laid out? I'm guessing that is where you have your thickness/radius/Kfactor?
@mitchell_braun924 I did the same thing. Made a material Library just to find out I wasn't going to be able to automate it. I forgot the doc wouldn't let you download the one imported there. Here is a link to the template https://docs.google.com/spreadsheets/d/1d2jfeFvYkBt3GW53Z23xK4Zd6WhGEl6iZRwQv7Xz4Zk/edit?usp=drivesdk