Replace detail Items not working?

Hi All,

Trying to develop a script in Dynamo for Revit 2019, to replace Detail Items with another detail item. I want the new Item to maintain the original items Instance parameter. I can get this to work in R20, but in R19, the parameters are listed as read-only.

Any suggestions on a workaround to get this working?

Error over 1st node: “Warning: Element.SetParameterByName operation failed.
The parameter is read-only.”
Error over 2nd node: “Warning: Internal error, please report: Dereferencing a non-pointer.”

I feel like there is a way to get around this issue that I am just not seeing. Any advice is appreciated.

First error: You want to fill both parameters “Family name” and “Type name” with the same value. (You use a list of parameter names, instead of parameter name). (Typ value/name can’t be equal to family value/name).

You maybe also need to use other nodes to get a correct input value. (object to string isn’t suitable i think).

I think you need 2 nodes. 1x for setting the family and 1x for setting the type of the family.

Second error:
I think you try to get a value from a family type instead of an instance object of a family type, so maybe the value for depth is empty.

I actually can’t take a closer look on it in dynamo, so it’s a bit a guess (i am writing on my smartphone and can’t take a look what object.type the nodes need ).

Hi, thanks for the reply.

I am fairly certain error 2 is caused by error 1.
I also know it will not accept the family type node as an input, and string from object has worked in similar situations.

I have also tried using 2 nodes to set the type and family, with the same result. I will attempt the changes you suggest and post new results.

Thanks!

Edit: removing string from object changes the error to:
Warning: Element.SetParameterByName operation failed.
The parameter’s storage type is not an Element.

Edit 2: re-adding the string from object node reverts the error back kto the “read-only” error.

New image of workspace in question: