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.
Are we able to return a Computed Suface Area of the Sheet Metal Top Side Only in FeatureScript?
I've been searching without luck to see if there is a FeatureScript that outputs into a custom table, the computed surface area of only the top or 'good side' of a flat sheet metal part on the flat? If not, is there a way to return this value in a FeatureScript that I'm not seeing?
The basic evArea returns the entire surface area.
The end goal is to include this in a custom table for use in drawings on a given sheet metal flat part drawing.
Thanks in advance for any assistance!
Best Answer
-
Caden_Armstrong Member Posts: 194 PRO
You will need to take a query for the faces of your part and narrow them down to just the faces on one side.
You can use qCorrespondingInFlat for a sheet metal part to find the flat version
and then use qParallelPlanes with antiparallel set to false. All flat pattern parts are in the Z direction so putting the XY plane will get the non edge faces.var flatModel = qCorrespondingInFlat(part);
var faces = qParallelPlanes(qOwnedByBody(flatModel, EntityType.FACE), plane(WORLD_ORIGIN, Z_DIRECTION), false);
or
qTangentConnectedFaces could also be used from a seed face without needing the flat, you just need to reliably find a face that isn't an edge face.
and for those who want this without doing it themselves, I sell a library of computed properties, which includes one that can do this. You can check it out through the fs.place marketplace: https://fs.place/Listings/HUK1UHJF8EQ6HS1NEVJ2SWH4BI1TOMT1www.smartbenchsoftware.com --- fs.place --- Renaissance
Custom FeatureScript and Onshape Integrated Applications0
Answers
You will need to take a query for the faces of your part and narrow them down to just the faces on one side.
You can use qCorrespondingInFlat for a sheet metal part to find the flat version
and then use qParallelPlanes with antiparallel set to false. All flat pattern parts are in the Z direction so putting the XY plane will get the non edge faces.
var flatModel = qCorrespondingInFlat(part);
var faces = qParallelPlanes(qOwnedByBody(flatModel, EntityType.FACE), plane(WORLD_ORIGIN, Z_DIRECTION), false);
or
qTangentConnectedFaces could also be used from a seed face without needing the flat, you just need to reliably find a face that isn't an edge face.
and for those who want this without doing it themselves, I sell a library of computed properties, which includes one that can do this. You can check it out through the fs.place marketplace: https://fs.place/Listings/HUK1UHJF8EQ6HS1NEVJ2SWH4BI1TOMT1
Custom FeatureScript and Onshape Integrated Applications
Thanks Caden! Appreciated!