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.
Configuring cable weight via FeatureScript: override mass directly, or override material density?
I'm building a FeatureScript feature to configure cables & tubes (many different types). For each cable type we know the weight per unit length (kg/m), the cross-sectional area, and the length — from which the total weight follows directly.
My question: what's the better approach for getting the correct weight on the part —
- Override the mass directly (compute
mass = kg/m × lengthin FeatureScript and write it as a mass property override), or - Override the material/density instead (set
density = (kg/m) / cross-sectional areavia a custommaterial()and assign it to the part, letting Onshape compute mass = volume × density automatically)?
Best Answer
-
I'd just change the material density and let onshape compute the mass… it keeps the script shorter and easier to mod later
1
Answers
-
I'd just change the material density and let onshape compute the mass… it keeps the script shorter and easier to mod later
1 -
I've done some custom features for hoses etc and I ended up overriding the mass because I had to also add in some non-geometric stuff. Some of the end fitting models had errors or were surfaces, which won't give a mass, so it estimated those. It also calculated the weight of hoses full of oil without having to model the oil. It might not matter for you, but I also expect the math-to-override method to perform slightly faster, which really only matters if you're putting a lot of these in one place or making a lot of tubes in one go. I's probably lean toward an override, but I don't think either way is wrong and you can always change from one to the other without a big overhaul.
0

