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.

Mass Properties

JWPJWP Member Posts: 11 PRO

I know i can select a part and click the scales to get the mass, however, is there a way to have a variable that displays the mass of a part?

I found the featurescript Mv Measure Value, which is very handy, but it doesn't do mass.

I also found evApproximateMassProperties in the featurescript manual, but i cant work out if it gives me a way to display the mass of a particular part.

Comments

  • Alex_KempenAlex_Kempen Member Posts: 248 EDU
    You probably want to use the getProperties method with PropertyType.MATERIAL to get the material of selected parts, which can then be used to get the density. Unfortunately, however, this is not usable inside of the feature body since parts regenerate (and FeatureScripts run) before user-defined properties are applied to parts, so calling getProperties inside the feature body doesn't actually work. Thus, if your FeatureScript doesn't set the density of the parts inside of it, you have to jump through some hoops to get the user defined density, usually by setting an always hidden parameter to be equal to the density via editing logic and then using that parameter's value inside your feature body. If you really want to get the user defined density, I can go into more detail about how to do it.

    evApproximateMassProperties can estimate the mass of parts, but it takes a density as an input, so it probably isn't the most useful to you unless you can get the density first. 
    CS Student at UT Dallas
    Alex.Kempen@utdallas.edu
    Check out my FeatureScripts here:



  • daniele_grandidaniele_grandi Member Posts: 2
    @JWP
    did you figure out how to do this? I'm also interested 
Sign In or Register to comment.