Get Paramter Value returns "null" when selecting only one element

I’m having an issue with getting parameter values when selecting elements in a revit project. What I’m basically doing is taking fabrication part data from fabricationCAD and writing it to a custom data filed in the form of shared parameters.

The end goal here is to allow users to select elements and copy fabrication data to revit parameters for use in schedules, filters, etc. I have a working script that does the entire project at once, but that can be time consuming and being able to update parameters based on selection would be nice.

This is what I have right now:

It works when selecting multiple elements, the problem arises when I select only one. When trying to run the script with only one element selected the get parameter value node from lunchbox seems to break. I think it is trying to iterate an array of one item and returning 0 as a result, but I don’t know enough about DesignScript to fix it or even know if that is really the problem. So I’m looking for alternate solutions.

image

Use the OOTB Node GetParameterValueByName instad of the lunchbox node

Unfortunately that node just returns numbers and not the name of the material.

what kind off revit element is it?
Part material what kind off parameter is that?

Put after the GetParameterValueByName node The OOTB node Material.Name

if that don’t work
use instead the Node:
Element.GetParameterValueByNameTypeOrInstance from Rhythm and after that node the node Material.Name

Can you try this as well and show us what it says? Want to make sure we are looking at the same information. Also can you check that (in Revit) in your Material menu that is shows the names correctly.

Here is both of your suggestions/requests.

The parameter is coming from the fabrication database used with the fabrication parts tool in revit. It has no autodesk material assigned to it. It is purely a data field coming from FabricationCAD, one of many fields I’m writing scripts for. As revit stands now we only have access to a few of the data fields in revit (circled in blue), but there are many behind the scenes that can be accessed with dynamo. That’s what I’m shooting for here, just brining those hidden data fields into revit so they can be used. Its working great, unless I’m trying to run the scripts on one element.

aaannnnnnd its working now… I don’t know why…

I gave up on this part and moved on to make a selection filter so that when selecting elements it only included Fabrication Parts. For some reason after attaching that filter to the rest of the graph it started running fine when one element was selected.

My guess is that the selection was somehow not a part of the fabrication system or was read only based on selection method/dialog box issues.