Parameter value gives me decimal values from "full" mm values

Hi,

I have a script with which I’d like to get out different parameters and their values. I have a python script which filters out the “null” values and I thought I’d try, with dynamo nodes, to get the parameter values for later sorting. (Sort does not work now in the script as it only focuses on “Diameter” and not “Diameter: value” - I have a bit to learn in terms of Python).

The issue is that the block gives me strange values. I can’t see the relationship between these except for that the ratio between them is the same, so 50 mm is twice as large as 25 mm and so is 0.164 to 0.082.

But what causes this and how could I get the proper values out?

Units issue. 50mm is 0.164 feet. Check the project units.

1 Like

I think you are right, but I don’t manage to figure out the place where I have managed such settings. I checked the project Units and I did also make a node which apparently checks for the project’s units:
http://dynamobim.org/forums/topic/project-unit-settings/

I scaled down on the code in the initial “python script”-node in case something there adjusted the output to imperial units instead of metric units, but I didn’t see to have luck with that.

I’ll get back to this once I’ve figured it out. Right now I might work with some temporary workaround. :slight_smile:

Take a look here:

Revit API works in feet internally and Dynamo converts only some of the values to project units. You can use the node from the MEPover package.

What type of families are you working with?

Out of curiosity, did you check the units in the families as well? If they report in inches you may see the parameter values in inches if pulling parameter values from element types. I would reccomend trying a standard node to retrieve the parameter values (including the nulls) to see if they report correctly. You can always remove nulls with a list.clean node instead if that solves the issue.

Another workaround is to multiply by the inches to MM conversion factor in a node after the Python script. This would work but if you get some values already in metric than you’ll be in worse case than before. As such you might want to look into adding a test like this:
Math.Round(A)==A? A: A*25.4

That will multiply the results by 25.4 if A isn’t a whole number (and therefore likely in imperial units), or leave it as is if it isn’t (and therefore likely in metric). Not foolproof though.

@Einar_Raknes @jacob.small

Hi,
The units in the families were in mm as well. I checked multiple different ones and tested on different projects and the same issue seems to follow in different families as well.
And it did continue when I pulled the values without scripts :confused:

But I thought that I’d try to test the suggested packages but I get this for both the MEPover package and the Clockwork package:

I found this thread related to it:

And it seems like I have some issue with security as browsing to https://www.dynamopackages.com/ fails.
I must see if I get that checked.