Macro to do surface area calculation
Macro to do surface area calculation
(OP)
I am working on a casting that will be a housing for some components and also have some heatsinkging ribs on the outer perimeter.
I am looking for a way to calculate the surface area of just the outer portion of the casting. I know that I can select the faces and use one of the measure commands in Solidworks but I would like to define a "selection set" and have Solidworks retain it for surface area calculations.
I am assuming that using a macro is the best way to do this. If anyone has been through this before or has some advice, please let me know.
I am looking for a way to calculate the surface area of just the outer portion of the casting. I know that I can select the faces and use one of the measure commands in Solidworks but I would like to define a "selection set" and have Solidworks retain it for surface area calculations.
I am assuming that using a macro is the best way to do this. If anyone has been through this before or has some advice, please let me know.






RE: Macro to do surface area calculation
Stefan Hamminga
EngIT Solutions
CSWP/Mechanical designer
Searching Eng-Tips forums
RE: Macro to do surface area calculation
RE: Macro to do surface area calculation
If it won't calculate for a surface turn it into a solid.
Don't know of any Macros to solve for each surface.
Regards,
Scott Baugh, CSWP![[pc2] pc2](https://www.tipmaster.com/images/pc2.gif)
FAQ731-376: Eng-Tips.com Forum Policieswww.scottjbaugh.com
RE: Macro to do surface area calculation
There are two constants you may want to modify. The current precision is two decimal places, and the current units are mm^2. To change these constants:
1. Edit the macro.
2. Right-click on frmFacesArea inside the Forms folder on the left-hand pane of the VBA editor and choose "View Code"
The constants are at the very beginning of the code. To change precision, change the number of zeros after the decimal in "#.00"
RE: Macro to do surface area calculation
Weevoe
RE: Macro to do surface area calculation
RE: Macro to do surface area calculation
weevoe
RE: Macro to do surface area calculation
Use Copy to copy the entire body. Then use "Delete Face" to remove one or more face from the solid without patching. This turns the solid body ito a surface body. Use "Delete Body" to get rid of extra surface bodies if you wish.
In the case of getting the exterior faces of the casting, you only need to remove the faces that define the border between outside and inside. As long as the border faces stay the same, the resulting surface body will update with the solid.
I used to use this method to maintain surface bodies used to calculate enclosed volumes.
http://www.EsoxRepublic.com-SolidWorks API VB programming help
RE: Macro to do surface area calculation
Thanks for the information TheTick. I will use it on my next casting project which reguires volume & surface area to be maintained.
weevoe