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.
FeatureScript access to complete material properties and the Onshape Material Library
I may have originally posted this in the wrong forum. I'm a bit surprised by the engagement.
https://forum.onshape.com/discussion/31431/featurescript-access-to-complete-material-properties-and-the-onshape-material-library#latest
I am a mentor for a FIRST Robotics team, and we recently started exploring Onshape Simulation. One of the first issues we encountered was that parts created by many of our custom FeatureScripts are missing the material data needed for simulation.
Our custom features already assign materials such as Aluminum 6061, but FeatureScript currently allows us to populate only the material name and density:
var myComponentMaterial is Material =
material("Aluminum - 6061", 2.72 * gram / centimeter ^ 3);
setProperty(context, {
"entities" : myBody,
"propertyType" : PropertyType.MATERIAL,
"value" : myComponentMaterial
});
After reviewing the FeatureScript documentation, it appears that density is the only material property currently exposed through the API. Consequently, the material assigned by FeatureScript does not include the additional properties required for simulation:
- Poisson’s ratio
- Young’s modulus
- Tensile yield strength
- Ultimate tensile strength
- Compressive yield strength
- Ultimate compressive strength
For example, the standard Onshape Material Library entry for Aluminum 6061 contains all these fields, but a FeatureScript-created material with the same name and density is not linked to that library entry. The user must manually reassign the material before the part is ready for simulation.
I would like to suggest exposing the complete material-property list through FeatureScript and/or providing a way to assign a material directly from the Onshape Material Library.
The library-assignment syntax might look something like this:
var myComponentMaterial is Material =
onshapeLibraryMaterial("Aluminum - 6061");
setProperty(context, {
"entities" : myBody,
"propertyType" : PropertyType.MATERIAL,
"value" : myComponentMaterial
});
It would also be useful to support complete custom material definitions:
var myComponentMaterial is Material = material({
"name" : "Aluminum - 6061",
"density" : 2720 * kilogram / meter ^ 3,
"poissonRatio" : 0.35,
"youngsModulus" : 6.89e10 * pascal,
"tensileYieldStrength" : 2.41e8 * pascal,
"ultimateTensileStrength" : 2.90e8 * pascal,
"compressiveYieldStrength" : 0 * pascal,
"ultimateCompressiveStrength" : 0 * pascal
});
The existing material(name, density) function could remain available for backward compatibility.
This capability would be especially helpful for teams and companies using custom features to generate standard parts, structural members, fasteners, and other components. Those features could produce simulation-ready parts automatically instead of requiring users to manually replace every FeatureScript-assigned material.
Comments
-
Stay tuned! Hopefully, updates quite soon (which is likely the reason for the lack of response). No workaround today, other than to manually input the material properties. You'd likely want to create a custom material library and then set your parts to it from the Part Studio part list or BOM.
But like I said, stay tuned!
2 -
This is 100% more of a response than what I got so far, and sounds like the one I was looking for.
0 -
I've been needing this too!
0 -
Update is out! Looks like you inspired the workflow video as well
0


