Can we recover the unit of mass as a parameter?

Hi all

I would like to be able to retrieve the "unit of mass" parameter of a part, so that I can display in a cartouche the mass with its unit, depending on the unit selected in the properties of the document.

Would you know if the "unit of mass" parameter exists, if so what is it?

Thank you in advance for your answers

 

2 Likes

Hello

The procedure to be followed is attached.

http://help.solidworks.com/2013/french/SolidWorks/sldworks/t_adding_custom_properties.htm

Good luck.

1 Like

Hello

There was a similar question here: http://www.lynkoa.com/forum/3d/propriete-unite-de-mesure?page=1 where @flegendre had to resign ourselves to doing otherwise.

The proposed solution is to force the measurement to a particular unit, not to retrieve the unit mass of the component.

2 Likes

Yes @Bart, it works as long as you don't change the units of your documents. If, for example, you take a part, and you put a unit in grams on it, in your background it will indicate a mass of 1500 kg, instead of 1.5kg in your example, since the unit of measurement is not a property.

It can happen for example if you recover parts or assemblies of dubious provenance.

:)

2 Likes

Indeed, as much as for me, I had misunderstood the meaning of the question... =)

 

Why in this case, don't you work with the same unit all the time?

1 Like

I was hoping to be able to modify this meter because I am required to make plans for parts weighing several hundred kg, but also parts weighing a few grams.

So to make it easier to read, small pieces in grams and large ones in kg.

1 Like

Alternatively, you could create a custom property that does the conversion automatically and create two columns indicating the mass in your title block, or instead of creating two columns, you can try to put a checkbox option in your property form editor to designate which unit you want to use, and link these checkmarks to your personal properties...  Otherwise, I don't see any solutions:(

Cdt

Joss

1 Like

Thank you Joss.G for your answer.

Here's how I solved this question (it can be useful to others)

Using Smartproperties:

 - Creation of the "MASSE_SW" property which is the SolidWorks variable "Mass"

 - Creating an Option with 2 choices:

  • "Mass in kg"
  • "Mass in gr"

 - under "mass in kg",

  • creation of the "MASS" concatenation property:

$MASSE_SW& &kg

 - Under "Mass in gr",

  • Creating the compute property "MASSE_G":

$MASSE_SW*1000

  • creation of the "MASS" concatenation property:

$MASSE_G& &gr

 

The whole thing works very well

Thank you all