Writing a number from excel to a number based parameter, and it scales?

I am writing a dynamo script for mass data entry to families for COBie.

The project i am working in, is set units to mm, we always work in mm here in UK.

I have created an excel sheet that lists all the COBie parameters for our procurement team to manually enter the data against the cells for an element type.

the script works flawlessly and enters all the correct data to all the list of parameters, apart from any of the parameters that are set to a number.

instead of writing the number that comes from the excel, an example is 2000, in a watch node going to the element.setparameterbyname it is 2000.

when i go to the family and look at the number it is been multiplied by a random number of 304.8

the shared parameter i am writing to come from the BIM Interoperability tools from autodesk.

ive chekced the units of both the project and the family and for distance and length, both are set to mm.

completely stumped as i have wrote many scripts that enter numbers, with no issues with the same nodes.

Hi the entry must be in feet in these nodes
When you work with the API you have to transform your lengths into feet
1 foot =304.8mm

edit:

import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference("RevitAPI")
import Autodesk 
from Autodesk.Revit.DB import *

import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

doc = DocumentManager.Instance.CurrentDBDocument

a=IN[0]/0.3048#m to feet
lvl=UnwrapElement(IN[1]) #level
b=Line.CreateBound(XYZ(0,0,0),XYZ(a,0,0)) #revit line


TransactionManager.Instance.EnsureInTransaction(doc)
w=Wall.Create(doc,b,lvl.Id,True)
TransactionManager.Instance.TransactionTaskDone()

OUT = w

cordially
christian.stan

1 Like

Or this node :point_down:.

3 Likes