Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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?

Domechanic
Domechanic Member, pcbaevp Posts: 14 PRO
edited September 28 in FeatureScript

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 —

  1. Override the mass directly (compute mass = kg/m × length in FeatureScript and write it as a mass property override), or
  2. Override the material/density instead (set density = (kg/m) / cross-sectional area via a custom material() and assign it to the part, letting Onshape compute mass = volume × density automatically)?

Best Answer

  • Ace_Caoile
    Ace_Caoile Member Posts: 15 PRO
    Answer ✓

    I'd just change the material density and let onshape compute the mass… it keeps the script shorter and easier to mod later

Answers

  • Ace_Caoile
    Ace_Caoile Member Posts: 15 PRO
    Answer ✓

    I'd just change the material density and let onshape compute the mass… it keeps the script shorter and easier to mod later

  • EvanReese
    EvanReese Member, Mentor Posts: 3,061 PRO

    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.

    Evan Reese
    The Onsherpa | Reach peak Onshape productivity
    www.theonsherpa.com