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.
Custom table/property for sheet metal area
Lucas_Kuhns
Member, csevp Posts: 105 PRO
Does anyone know how I could create a custom property for the area of a sheet metal part's flat pattern?
0
Comments
Here's a "step by step" process for created a computed property (the example computes the volume so all you need to do is figure out how to get the thickness and divide the two):
https://cad.onshape.com/FsDoc/computed-part-properties.html
About this specific question, yes, this is possible. @eric_pesty is right.
Here are some different approaches you could take:
Face area: Custom feature
Volume / thickness: Custom feature
FeatureScript 1821; import(path : "onshape/std/geometry.fs", version : "1821.0"); export enum Options { Description, Custom } annotation { "Feature Type Name" : "Set property area (CADSharp)" } export const setPropertyArea = defineFeature(function(context is Context, id is Id, definition is map) precondition { annotation { "Name" : "Face", "Filter" : EntityType.FACE } definition.face is Query; annotation { "Name" : "Tangent connected faces", "Default" : true } definition.tanConnectedFaces is boolean; annotation { "Name" : "Save as", "UIHint" : UIHint.SHOW_LABEL } definition.options is Options; if (definition.options == Options.Custom) { annotation { "Name" : "Custom property ID" } definition.customPropertyId is string; } } { const part = qOwnerBody(definition.face); var face = definition.face; if (definition.tanConnectedFaces) { const tangentConnectedFaces = qTangentConnectedFaces(definition.face); face = tangentConnectedFaces; } const area = evArea(context, { "entities" : face }); debug(context, face, DebugColor.GREEN); if (definition.options == Options.Description) { setProperty(context, { "entities" : part, "propertyType" : PropertyType.DESCRIPTION, "value" : toString(roundToPrecision(area.value, 3)) ~ " m^2" }); } else if (definition.options == Options.Custom) { setProperty(context, { "entities" : part, "propertyType" : PropertyType.CUSTOM, "customPropertyId" : definition.customPropertyId, "value" : area }); } });Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Great, I'll send you a DM.
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴