"The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone." - error

Hello,

Im pretty new in Dynamo. My puropse was to add multiple shared parameters to multiple families. I use script from user Weli from this thread: Adding shared parameters and apply formulas to multiple families - Packages - Dynamo (dynamobim.com)
Firstly i tried to use exact the same parameter used by Weli, and i got an error at SharedParameter.Add node:
“The referenced object is not valid, possibly because it has been deleted from the database, or its creation was undone.”


Did anyone had the same issue ? I dont know what causing this error, cant solve this on my own. Any help would be greatly appreciated.

I use Dynamo ver 2.12.1.8246
and Revit 2022
add_shared_parameter_to_multiple_families.dyn (31.6 KB)

@lkosowski ,

seems not to be a dynamo error. I got this when someone deleted a element. And i run the script before synchronicing… you have to to something like

# 👀 Check if Element is Taken (WorkSharing)
checkoutStatus = WorksharingUtils.GetCheckoutStatus(doc, wall.Id)
if checkoutStatus == CheckoutStatus.OwnedByOtherUser:
    print('[{}]Wall is Taken by Another User.'.format(wall.Id))
    continue

so you can skip the element thats not anymore there or owned by someone…

KR

Andreas

1 Like