# Attribute Error on Archi Lab Node

**URL:** <https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020>\
**Category:** Packages\
**Tags:** python, dynamo\
**Created:** [January 16, 2023, 11:02pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020 "2023-01-16T23:02:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markb43](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@markb43](https://forum.dynamobim.com/u/markb43)\
**Post date:** [January 16, 2023, 11:02pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/1 "2023-01-16T23:02:26Z")

</div>

I am trying to change utilize the “Set BuiltIn Parameter” Node from [Archi-Lab](https://forum.dynamobim.com/t/revit-2022-dynamo-2-10-package-not-showing-up-and-icons-missing/62933/7?) in Revit 2023

This is the python script inside of the code block.

```auto

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

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

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

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

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

paramName = IN[0]

if not isinstance(IN[1], list):
        elements = [IN[1]]
else:
        elements = IN[1]

if not isinstance(IN[2], list):
        paramValues = [IN[2]]
else:
        paramValues = IN[2]

def GetBuiltInParam(paramName):
        builtInParams = System.Enum.GetValues(BuiltInParameter)
        test = []
        for i in builtInParams:
                if i.ToString() == paramName:
                        test.append(i)
                        break
                else:
                        continue
        return test[0]

try:
        errorReport = None
        TransactionManager.Instance.EnsureInTransaction(doc)
        
        bipName = GetBuiltInParam(paramName)
        for i, j in zip(elements, paramValues):
                param = UnwrapElement(i).get_Parameter(bipName)
                if param.StorageType == StorageType.ElementId:
                        id = ElementId(j)
                        param.Set(id)
                else:
                        param.Set(j)
        
        TransactionManager.Instance.TransactionTaskDone()
except:
        import traceback
        errorReport = traceback.format_exc()

if errorReport == None:
        OUT = IN[1]
else:
        OUT = errorReport

```

When I run the script, the error it get is;  
Traceback (most recent call last):  
File"“, line 51, in   
File”", line 40, in GetBuiltInParam  
Attribute Error: ‘int’ object has no attribute ‘ToString’

I have spent a great deal of time searching attribute errors and anything else it could be, I am completely out of ideas. Could someone please help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![stefan.gokstorp](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@stefan.gokstorp](https://forum.dynamobim.com/u/stefan.gokstorp)\
**Post date:** [January 17, 2023, 6:01am UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/2 "2023-01-17T06:01:42Z")

</div>

are you sure the parameter you have plugged in is a built in parameter? [BuiltInParameter Enumeration (revitapidocs.com)](https://www.revitapidocs.com/2018.1/fb011c91-be7e-f737-28c7-3f1e1917a0e0.htm)

if its not in the list there the script will stop at that line which is what seams to be happening.

or the value there is null or emepty

---

<div class="post-metadata">

**Author:** ![markb43](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@markb43](https://forum.dynamobim.com/u/markb43)\
**Post date:** [January 17, 2023, 3:26pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/3 "2023-01-17T15:26:12Z")

</div>

Yes I am sure, I am using VIEWPORT\_DETAIL\_NUMBER, is there a reason this one would not work while looking at a sheet of details, does the detail have to be active?

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [January 17, 2023, 7:19pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/4 "2023-01-17T19:19:59Z")

</div>

hi @markb43

It’s a [Python.Net](http://Python.Net) issue, read this

> **[Work in progress to improve Python 3 support · DynamoDS/Dynamo Wiki](https://github.com/DynamoDS/Dynamo/wiki/Work-in-progress-to-improve-Python-3-support)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

in particular

> **[Work in progress to improve Python 3 support · DynamoDS/Dynamo Wiki](https://github.com/DynamoDS/Dynamo/wiki/Work-in-progress-to-improve-Python-3-support#python-primitives-are-not-net-objects-not-planned)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![markb43](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@markb43](https://forum.dynamobim.com/u/markb43)\
**Post date:** [January 17, 2023, 8:45pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/5 "2023-01-17T20:45:56Z")

</div>

Thank you! That fixed part the issue, but now created a new one. Now I have an error that reads

File “\<string”\>, line 65, in   
TypeError: No method matches given argument for get\_Parameter: (\<class ‘str’\>)

According to the article you provided this is something that should have been fixed?

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [January 17, 2023, 9:10pm UTC](https://forum.dynamobim.com/t/attribute-error-on-archi-lab-node/85020/6 "2023-01-17T21:10:44Z")

</div>

Try directly with the `BuiltInParameter`

example

```auto
TransactionManager.Instance.EnsureInTransaction(doc)

for i, j in zip(elements, paramValues):
    param = UnwrapElement(i).get_Parameter(BuiltInParameter.VIEWPORT_DETAIL_NUMBER)
    param.Set(j)

TransactionManager.Instance.TransactionTaskDone()

```
