Unit scale issue (mm)

Hello,

I am trying to pass in a value to a family paramter which is passed in as 2000mm, however after i pass it in the value comes back as 609.

I know this is an issue with the conversion between revit units and the revit api, but is there an easy way to convert all my mm units before I pass them in?

@eirannejad I know you wrote a script for curtain wall grid creator which factored this in, but I cant figure out how to just apply this scale factor to a number.

Thanks Guys!

@ssw1 Hello
Are your Revit and Rhino models follow the same unit settings? Are you using the RIR components or this is a scripted component you are working on?

Hi @eirannejad

They are both in mm (revit and rhino). I am using the set parameter component.

As I said, I know I had this same conversion issue with the add grid lines and you added a unit conversion to the script.

Thanks, Sam

1 Like

So like this?! Do you have screenshots?

Hi @eirannejad

Find attached screenshot- yes I am doing it exactly that way.

The parmater is just a shared instance parameter that I have made- its not actually referenced to any geometry (so its not breaking the family or anything).

You can see that the value going in and value going out is scaled up… it also seems it doesnt like negative values- as they get culled out (which is also another issue)

Thankyou! bit of a mystery to me

if it helps, i just did a division and it looks like its always around 304 as a scale factor.

Okay just to confirm are you on latest RIR and Rhino 7?! What’s the parameter Type? Is it a length parameter or something else?

Rhino 7, what and I believe I am on the most recent release.

Yes, it is a length based shared parameter that I change by instance.

Sam

Ok. I’d appreciate if you can share files so I can replicate the issue on my side. I tried different unit settings and GH always follows Rhino’s units as it should be. This might be an obscure bug.

@eirannejad sent to inbox. thankyou!

Ok great. This seems to be a cluster issue. I created package from the files that you sent.

@kike Would you mind taking a look at this? Seems like the units don’t get converted to GH in clusters

Test files are here:

Bad Value Get In Cluster_V20.rvt (1.5 MB) Bad Value Get In Cluster.gh (9.1 KB)

1 Like

Thanks guys, I still seem to be getting the error even when I move it out of the cluster- but will wait to see what you come up with!

I am still about confused about why I can not add a negative value though? do negative work with yours above?

Sam

There were a bug casting Integer inputs to parameters that take a Number like a Length parameter in this case.
If you like to test before updating, please change the integer parameter you have before the Set Element Parameter by a Number parameter or just nothing.

It’s fixed on the release from today, please update and tell us.

1 Like

Amazing, silly question but how do I push the most recent update.

I assume that I can also put negative values into this aswell? ie. from what @eirannejad is doing in his script, that could be say -25 and it inputs the parameter value as a negative?

Thanks so much for looking into this guys. Sam

Yes, negative values should work as well.

You need to download and install again, we still have no update nor auto-update mechanism built in.
Look here.

1 Like

Perfect! will let you know how it goes now i have down the reinstall.

1 Like

@kike @eirannejad

Thanks Guys! this works great following the update!

1 Like