Writing values to parameter from Excel-file

Hello I am trying to write information from an Excel-file to specifick elements. I have tried to use both GUID and BatID as identifier. I think the problem is in the ElementById-node or in the Element:SetParameterByName. The unconected nodes laying around are ones I have tried without sucsess. Anybody who can see a solution?


This script is a critical part of my exam which has to be finished before monday afternoon, any help will be much appreciated!

This is a link to a Dropboxfoleder where you can find a test model, the script, and the Excel-files needed:

Thanks

Leif

This is the error Im getting:

Have you updated the Archi-lab package? The Id to element-node seems to be working on my end:

And also, the link provided is for another folder completely I guess. (Altså Cv’n din+ prosjektoppgave. :wink: )

1 Like

Hei Leif!

It’s most likely the id to element that’s your problem, if Josteins suggestion doesn’t work you can try this:

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

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
items = IN[0]

elementlist = list()
for item in items:
	elid = ElementId(item)
	elementlist.append(doc.GetElement(elid).ToDSType(True))

OUT = elementlist

Thanx, i have changed the content in the folder. Will try your solution in a minute

I have tried Josteisn fix, updated the package. At least I get somthing out of the node:

Einars solution:

I dont know what I have done wrong, I copy/pasted the code and added "at the start and end of the code

Thanx for trying. I will get back to the problem tomorrow, maybe a good nights sleep will help :slight_smile:

You need to add a ; (semicolon) after the last " in the code block. Also make sure your ids are integers.

1 Like

The String.ToNumber node solved the problem. Thanx a lot!

Leif