Hi All,
Quick qs is it possible to add integer values to a key schedule or am i missing something,all other elements get set however i cant get the integer values applied.
I don’t think there is - you could modify the archilab node python
Crack open the node and update from line 53 to before # "End" the transaction in the second python node
I’ve also done a bit of refactoring so it does not check every element in the document, just the schedule
allKeys = FilteredElementCollector(doc, keySchedule.Id).WhereElementIsNotElementType()
params = [[] for i in range(len(keyNames))]
test = []
for key in allKeys:
try:
keyName = key.get_Parameter(BuiltInParameter.REF_TABLE_ELEM_NAME).AsString()
if keyName in keyNames:
indexValue = keyNames.index(keyName)
for i in range(0, len(inputParams),1):
params[indexValue].extend(key.GetParameters(str(inputParams[i])))
except:
pass
for i, j in zip(params, data):
for param, value in zip(i,j):
if isinstance(value, str):
valueDecoded = value.decode('string_escape')
elif isinstance(value, int):
valueDecoded = value
else:
if value == None:
valueDecoded = " "
else:
valueDecoded = str(value).decode('string_escape')
if upper:
valueDecoded = valueDecoded.upper()
param.Set(valueDecoded)
else:
param.Set(valueDecoded)
The code doesn’t look like it’s updated there should be an elif at line 69 and the filtered element collector should only be for the schedule view like this FilteredElementCollector(doc, keySchedule.Id) on line 53
Make sure to save the script after updating, then save the custom node and finally try your graph
Mixed tabs and spaces unfortunately - find and replace tabs with 4 spaces
I’m looking into how to update integers as my code change does not currently work
Note this is for your use case
You would have to check the parameter storage type is ‘Integer’ and then check if all data values are integers and convert (or just convert them with int(n))
Use the </> code option in menu, surround by single backticks (under esc key) or surround by triple backticks for a block. If you include the code language after the first triple backticks you get syntax highlighting
```python <code>
```
Thanks updated code below based of your first response from line 53 to before # "End" the transaction in the second python node.
Thanks again for the help.
Cheers KS
`<allKeys = FilteredElementCollector(doc, keySchedule.Id).WhereElementIsNotElementType()
params = [[] for i in range(len(keyNames))]
test = []
for key in allKeys:
try:
keyName = key.get_Parameter(BuiltInParameter.REF_TABLE_ELEM_NAME).AsString()
if keyName in keyNames:
indexValue = keyNames.index(keyName)
for i in range(0, len(inputParams),1):
params[indexValue].extend(key.GetParameters(str(inputParams[i])))
except:
pass
for i, j in zip(params, data):
for param, value in zip(i,j):
if isinstance(value, str):
valueDecoded = value.decode('string_escape')
elif isinstance(value, (int, float)):
valueDecoded = int(value)
else:
if value == None:
valueDecoded = " "
else:
valueDecoded = str(value).decode('string_escape')
if upper:
valueDecoded = valueDecoded.upper()
param.Set(valueDecoded)
else:
param.Set(valueDecoded)>`