Concatenate two multiline parameters

Hey all,

Currently I’m importing info from two columns an excel spreadsheet. In both columns, info is stored in one cell with multiple return lines in it. I’m porting that information to multi-line parameter in Revit. Works great. I’d now like to be able to concatenate those parameters into one item. Example

Cell 1

  • Cell 1 line 1
  • Cell 1 line 2
  • Cell 1 line 3

Cell 2

  • Cell 2 line 1
  • Cell 2 line 2
  • Cell 2 line 3

becomes:

  • Cell 1 line 1 + Cell 2 line 1
  • Cell 1 line 2 + Cell 2 line 2
  • Cell 1 line 3 + Cell 2 line 3

Not sure how to accomplish this, since the info inside each cell is read as 1 item not a list. Any thoughts?

Thanks in advance!

@hrasmussen See if this helps
image

1 Like

@AmolShah - nice. That was the solution. Put it all inside a Python node and posted here for posterity. It’s part of a larger script so ignore stuff that doesn’t seem to be doing anything.

import clr

clr.AddReference('RevitNodes')
from Revit.Elements import *

clr.AddReference('DSCoreNodes')
from DSCore import *

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

clr.AddReference("RevitServices")
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument

params = IN[0]
valueList = IN[1]

output = []
errs = []

for values in valueList:
	optioncodes = values[7].Split("\n")
	options = values[8].Split("\n")
	templst = []
	for optioncode, option in zip (optioncodes, options):
		templst.append(optioncode + " - " + option)
	output.append(templst)
# Return results...
OUT = output
1 Like