Get parameters data types

Hi,
is there a way to get the data type (i.e. integer, float, string/text, etc) of a given parameter either of system or component family?
I’m trying to export data to sqlite and i need to prepare the string data to add single quotes.
I managed to do so in python with the repr() function but I need to tell manually which parameters are to be converted in strings.
I wonder if there is a way to get the data types expected in revit for each parameter to use it as a comparison list to get indices.
If that’s not possible then I thought to loop through the parameter values of my list and check in python with various built in functions (i.e. isinstance(x, str) etc).

Thanks in advance for your help.

Hi @paolo.pozzoli,

You can use the Element Parameters Properties node to retrieve the storage type.

1 Like

Hi @Alban_de_Chasteigner,
fantastic!
Thanks a lot for the hint and for this wonderful node you created!

1 Like

Hi @Alban_de_Chasteigner,
I come back to you as I tried to use your node Element Parameters Parameter but I’m not sure about how to ensure matching Name VS StorageType.
I’m a beginner in Dynamo so my understanding of sorting lists may be poor.
I tried to sort the parameter names alphabetically and now I’m trying to match the StorageType in the same order. If I performed the sorting correctly (so showing the real connection parameter-storagetype) I’m puzzled that for instance for BaseFinish parameter Revit is storing the data as double…
Please see the image below and attached graph.
Thanks again for your help.
GetParamNamesNDataTypes_RoomsCategory.dyn (23.9 KB)

Hi,

The easiest way is to use a dictionary.
I don’t know why the OOTB dictionary nodes are failing.


GetParamNamesNDataTypes_RoomsCategory V2.dyn (18.5 KB)

Hi @Alban_de_Chasteigner, you were so fast!
It works a charm, thanks a lot!

In case you don’t have genius loci package installed (like me), we can do a more simple way:


Hope this would help :kissing_heart:

1 Like

Thank you @thongle3103! Nice to know
Bye

Is there a way to get the data of the family type ? I’ve tried two different ways, but failed.
It works with the wall, but not window, handrail.

@Alban_de_Chasteigner @thongle3103

Dynamo_GetDataType04a

Hi Congzheng,

It’s easy to retrieve the types of the system families with Element.ElementType, Family or Family and Type parameters.

However, it is not possible to find the Family(element) for system families. But it is possible to retrieve the name of the base family with the Element GetLoadableFamily node.

1 Like

That’s very magic. Thanks a lot.

“Type” for floor category is working

“Type” for window category is somehow working

“Type” for handrail category was not working, but with “e.Name” block, it works very well.

How to understand the principle of revit logic? when we use “e.Name” block, how can it knows we are looking for the “Type” name, instead of other names?

Hi @Congzheng

We use code block to take that object’s name. In this case, we are asking the code block to show the name of the parameter called “Type”.

You can look for more information in the Design Script document. It would be very useful to use design script in code block.

1 Like

Nice ! Thank you very much.