How to set a unit of mass to automatic

Hi all

Let me explain my question:

I created a cartridge that fills automatically, including the mass of the part/assembly. I fill all of this in via the custom properties. The small problem is that I have to work on parts weighing a few grams or a few tons. So I would like to be able to drive all of this from the properties, but I'm a bit lost.

Here's what I was thinking:

The idea would be that my kilogram or gram option would drive the unit of mass that I could integrate into the cartridge. But it's far beyond my skills.

If anyone has an idea, I'm all for it.

Thank you!

 

A way to get around the problem: to have 2 sets of templates (prt, asm, drw).

What version are you working on?

1 Like

It's a solution yes, but I was hoping to stay on a single game to make it as simple as possible.

 

I'm on the 2016 (unfortunately..)

Can't we work in KG and then tell Sw to make the mass x1000 when we click on gram?

Hello, unfortunately this is not possible, you can only choose a predefined unit, in your kg or g.

1 Like

Hello

As my colleagues have already said; It's not possible but in 2 clicks you can do it. At the bottom right of the screen you have access to it. See attached link.

http://www.lynkoa.com/forum/import-export-formats-neutres/arrondir-la-masse-dans-le-cartouche

1 Like

Hello 

Like my colleagues there is no solution without tinkering, look at the attached document.

May the force be with you


masse_g__kg.docx
2 Likes

Hello

No, it's not possible, but it is possible to integrate an Excel conversion table , and to juggle between the lines to display the desired unit. On the other hand , it will have to be completed and updated each time. 

1 Like

In fact it's pretty much the same as OBI WAN, but you can make formulas and make a drop-down list to choose more quickly.

Okay thank you very much anyway!

I know that the thing is doable by going through a macro (which we used to do in my old company), but impossible to succeed in doing it again. Worse weather!

Hello

You no longer have any contact in your old company??? If you still have any; he could send you the macro...

Hello

By macro it doesn't seem very complicated to me. All you have to do is get the value of the annotation with the mass, convert it and replace it with a visible note (playing with the layers to hide/show) the annotation containing the mapping to sw-mass.

2 Likes

I want to believe you on how easy it is to do it. When you have the competence :D

I've never done macro, I don't even know how to do them.

1 Like

Hello

 

I looked into the macros, and I made the one I needed (I joined him, if anyone would ever need it).

 

The last bit I can't do is to have the automatic mass unit in the drawing. Today, the text is "Mass: $PRPSHEET:"Mass" Kg". I would like to replace the Kg with a code that brings it directly.

If anyone knows the code to put in, I'm interested


masse.swp
1 Like

2 simple solutions without macro:

 

1. Put the units in kg with 3 digits after the decimal point

 

2. Otherwise in 3D, create in equations a variable_globale (Mass2) = Mass*1000

Then in the properties create Masse2 and point to the new variable_globale

(as a reminder, this kind of calculated properties are always put in the config, not in the general (custom) tab)

And in the outline, create 2 layers "MasseKG" and "MasseGR" each pointing to the corresponding PRPSHEET, and adding the unit textually.

Leave only one visible.

And when you have to switch, use layers.

1 Like

I don't know VB but:
- you probably have a variable who "knows" that you are in kg or g;
- I guess the text "Mass: $PRPSHEET:"Mass" Kg" can be stored in a variable, which will be called by the note function. It (the text) can therefore be constructed by concatenation with case management (if then else is enough).

This is precisely the variable I'm looking for.
The variable £PRPSHEET:"Mass" calls the mass, but not its unit, so I think there must be one like £PRPSHEET:"UnitsMasse", but not found.

No, I don't think there are hidden variables....

When you look at the good help pages, or in the menu of the software, you find all the "possible variables"

I would be surprised to find others...

 

That's why I suggest working with 2 prp, and playing on layers.

Or to pass for 000,000.

 

Why, because it allows you to stay with the basic features of the software, it's automatic, repeatable, relatively reliable...

Without having to go looking for macros.