'FamilyInstance' object has no attribute 'LookupParameter'

This is weird, API docs says it has such a method: FamilyInstance Methods

Still, Dynamo claims it does not:

this is Revit 2021.4 and Dynamo 2.6

@danail.momchilov ,

maybe it is a library issue use the template:

import clr

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

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

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

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

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
element = UnwrapElement(IN[0])

#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

TransactionManager.Instance.TransactionTaskDone()

OUT = element

https://primer.dynamobim.org/10_Custom-Nodes/10-6_Python-Templates.html

you have also to Unwrapping your elements!

1 Like

@Draxl_Andreas Thank you for your answer and suggestion!

I saw what’s wrong:

Had to Unwrap the list (just like you said) and then actually extract the value from that parameter :slight_smile:

3 Likes

This article look at the issue of unwrapping revit elements and why it is required (sometimes).

1 Like

@Antonio_Vachev,

it is like eating a banana you have to unwrap it, to have more options:


7 Likes

That’s a nice comparison :grinning:

@danail.momchilov i love cooking, but not cleaning the kitchen.

1 Like

me too, actually…

Where is that link?

yeap, I was curious also

Dynamo DACH Usertreffen 8.12.2020 I Autodesk - YouTube @jacob.small @danail.momchilov

When i would write a manuel for dynamo and Revit API. Maybe you would have been any ideay of it, BUT you would be a great Cook :slight_smile:

3 Likes

That is hands down my favorite diagram for unwrapping ever. It should definitely be in the Dynamo Primer in and future incarnations if not. Needs a ‘forgot to unwrap’ diagram too showing a sad banana sitting in an icecream bowl with skin on.

3 Likes


I try to think in pictures… …to understand programming is difficult… :slight_smile: @GavinCrump

2 Likes