Problems with SpecType and GroupType to create shared parameters

Hi! I’m trying to create shared parameters in Revit with dynamo using a spreadsheet. The spreadsheet has the columns ParameterName, SpecType, GroupType, Instance and CategoryList. When I read the values with dynamo, I obtain list of strings.

The problem is that the entrance to SpecType and GroupType in the Parameter.CreateSharedParameter node isn’t a string. When I run dynamo it gives me the following error: “Parameter.CreateSharedParameter expects argument type Revit.Elements.SpecType, Revit.Elements.GroupType, but was called with string, string.

Is it possible to convert the list of string in the types SpectType and GroupType?

imagen

Hello and welcome to the forums!

It looks like you are looking for this.

1 Like

Hello!

First of all, I would like to thank you for your help. As you say, that’s what I’m looking for.

I have replicated the same as you indicate, but I get the error of the first image (Revit version 2023 and Dynamo 2.13).

The line 53 is the last line of the code:
OUT = [Revit.Elements.SpecType.(v.TypeId) for v in lst_db_specTypeId]

I have seen that the Python script node it’s different (CPython 3), so I have installed the DynamoIronPython3, but I can’t change the Python Engine version. I have tried all versions of the package.

I have tried to do the same in Revit 2024 and Dynamo 2.18. In this case, with the Python node CPython 3 the error is the same as before (first image). However, with the Python node IronPython3 the error is another and depends on the version of DynamoIronPython3. With the version 1.0.0 and 1.1.0 to IronPython3 the error is like the previous one (first image), but with the version 1.2.0 and 1.3.1 it’s the one in the second picture.

I don’t know if this information could tell me why I’m getting this error.

Thank you very much.

Snip your whole graph, and show the strings going into the python node that you want the spectype.

Try ironpython2 as well

Solved the problem with ironpython2. Thank you very much for everything!