Change Parameters of Objects in Linked File

Hi everyone,
I wish to change some parameters of elements in a linked file and I can´t get it to work. The normal “Element.SetParameterByName” gives the same error as shown in the picture.

#Copyright(c) 2015, Konrad K Sobon
# @arch_laboratory, http://archi-lab.net

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

# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import geometry conversion extension methods
clr.ImportExtensions(Revit.GeometryConversion)

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

#doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application

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

import sys
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)

doc = UnwrapElement(IN[1])
data = IN[0]

TransactionManager.Instance.EnsureInTransaction(doc)
for d in data:
	d.SetParameterByName("Raumbegrenzung",False)
TransactionManager.Instance.TransactionTaskDone()

OUT = doc

I´m suspecting that the Revit Node “SetParameterByName” does not use a doc. Do I have to use the Revit API to set the parameter or is there a mistake in my code?

Thanks and kind regards,
Jannis

Found the solution by using “SetParameterByName in Document” from the GeniusLoci Package.