Units ( power and speed )

For a custom parameter space (or Watt unit m3/h french)

When importing data (number) from Excel with Dynamo, I have an error when injecting the value in the parameter space. Dynamo consider myself a number on one side, and a value in watts or m3 / h of each other.
How to convert a number (no units) in Watts or m3/h?

Watt frenchBtu
m3/h french CFM

Hi Alain,

Assuming the values in Dynamo are in CFM then you need to multiply by 1.70 to get m3/h.

Hello,
I’m not trying to convert the values, but give unity to a number.
Number without unit w or m3/h in my parameter space

The parameter value is a string?
Then just add the desired suffix to the number

n + "w";

n + "m3h/h";

No string,

If it is not a string, then the units are assigned automatically in Revit based on the parameter type (Volume, Length, Area…). The parameter type is assigned to the parameter when it is created.

It will be better for you to illustrate with Dynamo/Revit screenshots.

Thank you for your answers, I would come tomorrow with a screenshot

Screenshots

Error Element.SetParameterByName

Hi Alain

When I normal makes this setup, then I prefer to make the convert between units in Excel. Simple done by making an extra column in excel, where you make the convert. The extra column I then hide for the user.
I know it is not great, but it is works :slight_smile:

Hi,

What does the error says “Element.SetParameter” node. I believe when you create parameter it should have that units and then feed just values it will show up with values with units.

@Alain_Hamel You might need some unit conversion. Try this…
Spaces.dyn (7.1 KB)

Hello,
Still effective.
So the principle is to convert the units ‘original’ Dynamo, and not the reverse.
But at home I have a value [0] null in the combined list.
I have good values, but not in a good space.

My guess is that the storage type of parameter Numero is text, not a number.
Try making these alterations in the code block …

n1=n<1>*{1,0.009809629667106,1};
n2=n1<1>+{"",0,0};

Number of space is not TEXT?
-> Value Not used for 3 spaces

The correspondence between the number of the space and the flow value is not respected.

Realized you have only two parameters now
The code block should reflect that.
If Numero parameter type is a number, making this change in the code block should hopefully sort out the issue

n<1>*{1,0.009809629667106};

Numero has not a number format because it can have as A10 value.

:slight_smile: Since it’s not a number…

n1=n<1>*{1,0.009809629667106};
n2=n1<1>+{"",0};

really sorry for this loss of time, but its not working.

I do not understand this part of the code,
n1=n<1>*{1,0.009809629667106};
n2=n1<1>+{"",0};
do you have a web link or explained?

Using the first line (n1), we multiply the first item of each sublist by 1 and the second item by the conversion factor
In the second line (n2), we convert the first item of each sublist to a string by adding an empty string to a number and add 0 to the second item to leave it unchanged.