Overriding part mass with an equation
Posted: Sun Aug 20, 2023 11:16 am
Hi, this might be an unusual question, so I'll explain the context first. I design a lot of parts in SW that will be 3D printed with partial infill. I usually know the percentage of the infill in the design phase, but the infill geometry is generated by slicer software after exporting from SW. Mass calculations are very important in my designs, and I like to keep track of them while making changes to the part. Now, although I know the densities of the plastics I am going to use, that doesn't account for partial infill. So if I design a solid part in SW and assign the material, it's mass won't be realistic since it doesn't account for the infill. Ideally, I would like to override the mass of the SW part with an equation like =SW-Mass * 0.1, where 0.1 represents 10% infill (this doesn't account for the shell, but I'm keeping it simple here). However, as far as I know, there is no way to override mass for a part with anything parametric. So what are the alternatives?
Things I considered:
1) Creating a configuration of the part where the solid body is shelled to particular thickness until a realistic mass is achieved (I can tune this against the slicer mass predictions), and after I make modifications to the part, shelling would still correct the mass to an acceptable degree. Issue is, this won't work since a lot of parts cannot be shelled due to their complex geometry, or are multi-body parts and it would be very tedious to shell each one.
2) Create multiple materials that have mass densities adjusted to account for infill, for example: PLA-5, PLA-6, PLA-7, representing 5%, 6%, 7% infills, etc. However, this also won't work since I'd have to create dozens if not hundreds of materials like this.
3) Use Equations to calculate the adjusted mass, and maybe output it to Custom Properties. Not bad, but it won't let me do center of mass calculations in assembly, which is also very important (different parts will have very different infills, so it matters).
4) Use a macro that runs on every save/rebuild, and overrides the mass by re-calculating it from the SW-Mass - my last resort, I'd like to avoid this if at all possible, such macros are pretty nasty.
If only I could create a body in the part with negative mass that would offset the actual mass by a parametric amount... Unfortunately SW doesn't support exotic matter yet
Can anyone suggest a better approach?
Things I considered:
1) Creating a configuration of the part where the solid body is shelled to particular thickness until a realistic mass is achieved (I can tune this against the slicer mass predictions), and after I make modifications to the part, shelling would still correct the mass to an acceptable degree. Issue is, this won't work since a lot of parts cannot be shelled due to their complex geometry, or are multi-body parts and it would be very tedious to shell each one.
2) Create multiple materials that have mass densities adjusted to account for infill, for example: PLA-5, PLA-6, PLA-7, representing 5%, 6%, 7% infills, etc. However, this also won't work since I'd have to create dozens if not hundreds of materials like this.
3) Use Equations to calculate the adjusted mass, and maybe output it to Custom Properties. Not bad, but it won't let me do center of mass calculations in assembly, which is also very important (different parts will have very different infills, so it matters).
4) Use a macro that runs on every save/rebuild, and overrides the mass by re-calculating it from the SW-Mass - my last resort, I'd like to avoid this if at all possible, such macros are pretty nasty.
If only I could create a body in the part with negative mass that would offset the actual mass by a parametric amount... Unfortunately SW doesn't support exotic matter yet
Can anyone suggest a better approach?