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.

Possible MASS_OVERIDE Bug?

EFishEFish Member Posts: 16 EDU
I'm currently finishing up a bearing generator with a list of bearings preset from VEXpro. But also can generate its own bearings. I'm trying to apply a mass to the preset bearings, but it returns an error when a numerical value with a unit of weight is applied.

Precondition of setProperty failed (definition.value is string)
     54:9       onshape/std/properties.fs (setProperty)
     227:13   In-Place Bearings (const myFeature)
     55:17     onshape/std/feature.fs (defineFeature)
     Bearing Testing (In-Place Bearings)
     Bearing Testing

When given a string value, the properties tab errors out. So I'm curious if this is a legit bug in the system, or if I'm doing something wrong, and if there is a workaround. Thanks in advance!

Here is the document link: https://cad.onshape.com/documents/028ca8fb10baf53e1f6fce96/w/b1250a450d0ba88f0a8b1811/e/aea21598d349c81bcdcee291
FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Tagged:

Comments

  • Alex_KempenAlex_Kempen Member Posts: 248 EDU
    edited June 2021
    Okay, the precondition for setProperty is definitely missing an else if (definition.property == PropertyType.MASS_PROPERTY_OVERRIDE), especially since the documentation clearly says "a value with mass units if it is `MASS_OVERRIDE`". @lougallo, can you tag this as a bug?

    For now, a workaround is probably to play games with your material density. You might also be able to type @setProperties(context, definition) to call setProperties directly, bypassing the precondition.

    As a side note, I find your FeatureScript interesting, but I do want to note that instantiating multiple bearings in a part studio is probably not great since they won't work properly with the BOM (Kinda an Onshape internal limitation), and they'll hurt performance across the board (This is also why my Belt FeatureScript no longer offers COTs pulleys as an option, although it definitely did make me sad to disable them). You can, however, mitigate some of this by offering an option to exclude your bearings from the BOM entirely. 
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • EFishEFish Member Posts: 16 EDU
    Yes, I am aware of the BOM issues, I will definitely add the option to exclude from the BOM, thank you for the suggestion. The main idea of this script is to make it easier to insert bearings so that rather than having to derive from mkCAD or from and import, it will be able to generate in place. Which I think is more efficient anyway, as well as it would make it easier to generate any bearings that are not available on VEXpro.
    FRC Team 2471 Designer - Alumni
    Seattle Pacific University - Mechanical Engineering
    efishg2020@gmail.com
  • lougallolougallo Member, Moderator, Onshape Employees, Developers, csevp Posts: 2,005
    I have pulled a bug for you two.
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
Sign In or Register to comment.