# Formatting excel data types for family parameters

**URL:** <https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787>\
**Category:** Revit\
**Tags:** python\
**Created:** [February 28, 2022, 2:38pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787 "2022-02-28T14:38:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [February 28, 2022, 2:38pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/1 "2022-02-28T14:38:12Z")

</div>

Hi - I’m trying to format some excel data for input into family type parameters (that are shared), and keep getting “The parameter’s storage type is not a number”. In the screenshot, I have compared the object.type for both my excel data and the parameter storage types - they appear to match, other than the python node outputting System.\* types instead of native Revit integers, doubles, etc. Is that what is causing the issue? You can ignore IN[0] in the python, it’s not doing anything yet.

```auto
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

# The inputs to this node will be stored as a list in the IN variables.
famtypes = IN[0]
params = IN[1]

# Format parameters
for param in params:
	# ID
	param[0] = str(param[0])
	# Name
	param[1] = str(param[1])
	# Depth
	param[2] = float(param[2]/12)
	#Height
	param[3] = float(param[3]/12)
	# Width
	param[4] = float(param[4]/12)
	# Weight
	if param[5] == None:
		param[5] = 0
	else:
		param[5] = int(param[5])
	# Counter or Floor
	if param[6] == None:
		param[6] = ''
	else:
		param[6] = str(param[6])
	# Relocated?
	if param[7] == None:
		param[7] = 0
	elif param[7].lower() == "y":
		param[7] = 1
	else:
		param[7] = 0
		
	# Location
	if param[8] == None:
		param[8] = ''
	else:
		param[8] = str(param[8])
	# Power
	if param[9] == None:
		param[9] = 0
	elif param[9].lower() == "y":
		param[9] = 1
	else:
		param[9] = 0
	# Dedicated Circuit
	if param[10] == None:
		param[10] = 0
	elif param[10].lower() == "y":
		param[10] = 1
	else:
		param[10] = 0
	# BTU
	if param[11] == None:
		param[11] = 0.0
	elif param[11].lower() == "y":
		param[11] = 1.0
	else:
		param[11] = 0.0
	# Water
	if param[12] == None:
		param[12] = 0
	elif param[12].lower() == "y":
		param[12] = 1
	else:
		param[12] = 0
	# Drain
	if param[13] == None:
		param[13] = 0
	elif param[13].lower() == "y":
		param[13] = 1
	else:
		param[13] = 0
	# Computer
	if param[14] == None:
		param[14] = 0
	elif param[14].lower() == "y":
		param[14] = 1
	else:
		param[14] = 0
	# UPS
	if param[15] == None:
		param[15] = 0
	elif param[15].lower() == "y":
		param[15] = 1
	else:
		param[15] = 0
	# Printer
	if param[16] == None:
		param[16] = 0
	elif param[16].lower() == "y":
		param[16] = 1
	else:
		param[16] = 0
	# Notes
	if param[17] == None:
		param[17] = ''
	else:
		param[17] = str(param[17])
	

# Assign your output to the OUT variable.
OUT = params

```

 ![Equipment Creator_2022-02-28_09-28-52](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/c/1c7a4a0256ad2790ecf26b3833b1b232224a4cbd.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [February 28, 2022, 3:21pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/2 "2022-02-28T15:21:13Z")

</div>

> [@jackchaskell](#):
>
> ```auto
> if param[11] == None:
> param[11] = 0.0
> elif param[11].lower() == "y":
> param[11] = 1.0
> else:
> param[11] = 0.0
> 
> ```

Should these just be 1 & 0 like the rest without the .0?

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [February 28, 2022, 3:56pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/3 "2022-02-28T15:56:38Z")

</div>

Duh…yep. Overzealous copy and pasting on my part!

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [February 28, 2022, 9:33pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/4 "2022-02-28T21:33:08Z")

</div>

Actually, I’m still running in to the same error with that bit fixed. Indices 2, 3, and 4 are decimal inches/12 in the Python script, but they are for 3 length parameters in the family type. Do I need to do any conversion to get usable project units from those? I’m thinking that’s the issue.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 1, 2022, 1:16am UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/5 "2022-03-01T01:16:12Z")

</div>

Can you share an image with the error and results visible? Everything looks good from what I can see this far, unless one of your IF statements is throwing a null somewhere.

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [March 1, 2022, 11:22am UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/6 "2022-03-01T11:22:43Z")

</div>

Yep, here you go. The setparameter node is giving nulls for the length parameters and all of the yes/no’s.

 ![Equip Creator](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/559f1e2a618b20a5c510180534644d08818068f8.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 1, 2022, 12:33pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/7 "2022-03-01T12:33:38Z")

</div>

I would go through and try to set each one individually. I would also try to remove the float() and divide by 12.0 to force the double. I now see False and True, did you change from 1 and 0 for the Yes/No parameters?

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [March 1, 2022, 12:51pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/8 "2022-03-01T12:51:33Z")

</div>

Yeah, I think that’s what I’ll have to do. I did switch the yes/no to boolean outputs to see if that worked w/ the parameters, but both True/False and 1/0 give me a null in the setparameter node. In the past I haven’t run in to this issue when formatting excel data for parameters, but it sure is giving me trouble on this - probably one value that is messing it up.

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [March 3, 2022, 3:52pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/9 "2022-03-03T15:52:18Z")

</div>

@SeanP so I’ve gone through and tested each parameter one by one, and they all work just fine - but when I run them all at once, the error comes up. Any idea of whats going on to cause that? Lacing/list structure?

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 3, 2022, 4:00pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/10 "2022-03-03T16:00:03Z")

</div>

It may be a string to number conversion issue steming from excel maybe? I’ve seen that time to time.

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [March 3, 2022, 4:04pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/11 "2022-03-03T16:04:46Z")

</div>

That should cause one of the parameters pop up as an error when executed individually though, right? None of them did.

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 3, 2022, 5:40pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/12 "2022-03-03T17:40:31Z")

</div>

Is there any chance you could share a sample mode, family(s),and data set?

---

<div class="post-metadata">

**Author:** ![jackchaskell](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jackchaskell/32/91564_2.png) [@jackchaskell](https://forum.dynamobim.com/u/jackchaskell)\
**Post date:** [March 4, 2022, 12:22pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/13 "2022-03-04T12:22:08Z")

</div>

I actually gave up on the setparameter node and handled all the parameter setting/update in the Python node. Works perfectly now 🙂 Thanks for helping!

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [March 4, 2022, 12:58pm UTC](https://forum.dynamobim.com/t/formatting-excel-data-types-for-family-parameters/73787/14 "2022-03-04T12:58:19Z")

</div>

I thought about suggesting that, but wanted to try and answer the question asked, but good choice!
