Pipe sizing using fixtures

i ran a script for pipe sizing but it doesn’t take the values from excel. the pipe elements takes diameter value based on the fixture units as index.
Pipe Sizing.dyn (39.5 KB)


Fixture.xlsx (8.8 KB)
how can i fix the issue?
i want the pipe diameter to be based on fixture units from excel.

@kevinajiLFMQE ,

I switched to .csv format is more stable
Fixture Units i can`t finde … :confused:

Pipe Sizing_V1.dyn (52.4 KB)

Try unfreezing this graph. I threw a random list together to simulate parameter data, redirect the actual data to where the simulated data is feeding into.

From what I could tell you were having the Excel values come in as doubles, as is the default, but by extracting the values as strings, then you were able to correlate your target data with your parameter data. I couldn’t get a double to convert to an integer nicely, so I just changed everything into strings.

i tired but it shows null

What does the yellow error message read?

Warning: Element.SetParameterByName operation failed.
The parameter’s storage type is not a string.

So add a “String from Object” node in between ‘Element.GetParameterValueByName’ and the ‘List.IndexOf’ nodes, like in the file below.

Pipe Sizing_V2.dyn (54.9 KB)

Try this out

it shows error


Warning: List.GetItemAtIndex operation failed.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Warning: Element.SetParameterByName operation failed.
The call is ambiguous between the following methods or properties: ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, Revit.Elements.Element)’ and ‘Revit.Elements.InternalUtilities.ElementUtils.SetParameterValue(Autodesk.Revit.DB.Parameter, string)’

Can you show more information on the graph and what some of the results look like? The results for the pipe elements and their parameter values?

for the example… if the pipe has fixture 2 it should take corresponding diameter value from excel i.e 15

Ahh I see now. Expand that code block that’s there, it will tell you the type of the values that you feed it.

But basically you kind of have two options:

Add a Code Block after the ‘String from Object’ node that reads:

DSCore.String.Remove(x,DSCore.String.Length(x)-7,7);

and then feed that into the ‘List.IndexOf’ node.

ooorrrr

you can get rid of the ‘String from Object’ nodes and have the beginning pull the excel data in without converting it to a string.

Try throwing in the code block and see if it works first though.

What does the error message say?

Warning: Element.SetParameterByName operation failed.
The parameter’s storage type is not a string

Hello have you tried string to number

yea… it didnt work as well.
the thing is i want the pipe to take the diameter based on its fixture units using excel but the dynamo script takes the corresponding index value as i used list.get item at index node.
i was thinking is there any othr node tht could replace and do the work as i wanted?

Hi Mate,

The issue with your null message is because pipe size is not a string. It is a value - integer.

Allow me to answer: “for the example… if the pipe has fixture 2 it should take corresponding diameter value from excel i.e 15”

In this example i have given a random pipe fixture unit as 12. the code was able to use this info to get the corresponding pipe size which is according to your excel sheet DN40.

now to further take this code to check the fixture unit of the pipe against your excel data and apply the correct pipe size back to the pipe in revit by using this custom condition based parameter assignment:

so your code should look like

Para1 is the initial Fixture unit of the pipe (note this should be read as a string)
SetValue is the excel sheet indexed pipe size (note this should be read as a value - integer)

Hope this helps.

Cheers
DA