Hi Kyle, I have replicated your Space Planning Dynamo routine, but it is not working. I get an error in the first two nodes that regroup the “Width and Length values by Department.” This generates other null values. I have created a Mass family and materials specific for this routine. I have only added two rooms to my Excel file to test it. Could you please give me a hand with it? Kind regards, Mr. Haley Bueno.
The first error I get is in the nodes that regroup “…the Width…” and “…Length values by Department count”
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
List.GetItemAtIndex operation failed.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
The second error is found in the node that sums “each with sublist to get total point distance” Warning: Null value cannot be cast to Double Null value cannot be cast to Double Null value cannot be cast to Double Math.Sum operation failed. Value cannot be null. Parameter name: source
Then I get errors in the Point.ByCoordinates node
Warning: Null value cannot be cast to Double
Null value cannot be cast to Double
Null value cannot be cast to Double
Math.Sum operation failed.
Value cannot be null.
Parameter name: source
And in the FamilyInstance.ByPointAndLevel node
Warning: Null value cannot be cast to Double
Null value cannot be cast to Double
Null value cannot be cast to Double
Math.Sum operation failed.
Value cannot be null.
Parameter name: source
For the first warning: try changing the lacing to Longest for List.GetItemAtIndex
The others might sort themselves out.
I’m just guessing though, don’t really know how the script actually works.
These errors are telling me that you likely have a node that isn’t working upstream of the List.GetItemAtIndex nodes [image 1]. Go to each previous node and expand the preview box-one-by-one until you track down the first node that is generating a null [image 2]. In the original hi-res image that was shared on the Dynamo blog and in other locations, I had swapped out the LunchBox Mass Addition node with a Python node with the code pasted in (this allows you to forego having to download the LunchBox package on every new machine that will be running this definition)… my bad. Try replacing the Python node you have in the upper section [image 3] with the Mass Addition node [image 4] and see if this resolves the null values?
Hi Vikram and Kyle.
Thank you very much for your suggestions. I will check them all and give you a feedback as soon as possible.
Kind regards,
Haley
Hi Vikram, the Lacing longest repaired the first two errors. So, thank you for that.
I now need to make the corrections as per Kyle’s suggestions to see if the rest can be fixed. Thank you again.
Hi Kyle. I followed Vikram instructions and it fixed the first two errors connected to the Width and Length [Image 1]. However, when I changed the Python Script with the LunchBox Mass Addition, I got null values within the LunchBox.Mass Addition which generated errors in the List.AddItemToFront and in the second Code Block bouncing back to the Width and Length nodes as you can see in the image below [Image 2]. Then, the other errors in the Math.Sum and in the Point.ByCoordinates are still there. The first null values appear the in the List.Transpose before List.Map and Math.Sum [Image 3 and Image 4]. I have added a Python Script between the Math.Sum and the List.Map nodes and the Point.ByCoordinates node has fixed itself. I don’t actually know why but it did. [Image 5] However, I lost two elements from my list and the results were all 0,0,0. If I leave Python Script there, then I get the null values in the List.Combine [Image 6]. If I remove the Python Script, then the resut is see in Image 7. Is there anything else that I can do to fix the errors? I thank you beforehand for your help and attention Kyle.
Haley, can you expand the preview at the List.CountOccurences node [image 1]? Since the Python Script node is generating a 0 and LunchBox Mass Addition, I have a feeling that there are still issues earlier on in the process. I see that the Excel file you are feeding in only contains two lines of information, it may help to add 5-10 more to help troubleshoot with a larger dataset.
Working on my own projects tonight I discovered that the LunchBox Mass Addition node is longer working [image 1], which may explain why Haley’s definition is breaking…
Does Mass Addition work for anyone else?
Nevermind, got the LunchBox Mass Addition node working with a restart and adding a list.map to my workflow…
Haley, please post updated screenshots after trying the suggestions above.
Hi Kyle. Apologies for the delay on replying to your message. I have expanded the list for the List.CountOccurences as per your request. Please, see image below. I thank you beforehand for your help and attention.
Hi Kyle. I was not sure where I needed to connect the f(x) from the new List.Map. So, I did the way as shown in the image below. Unfortunately, I had no positive result from this addition.
Hi Kyle. I have added more rooms to the Excel sheet, and I have also found out that the List.CountOccurences node is usually where problems start. Therefore, I have copied the coding from the node directly into your routine and the result can be seen in the second image below where it a warning shows up stating that “GroupByKey()” was not found. Do you have any idea what should I do next? I thank you once again for your help beforehand. Kind regards, Haley.
I found this workaround for the GroupByKey error:
In newer versions of Dynamo it might work on changing GroupByKey in the code block to GroupByFunction
Thank you Jordan and Vikram.
New here, but trying to get edified on dynamo workflow to revit. I am totally intrigued by the SHepley Bulfinch program code. I have been replicating the nodes, using 0.9.1 but i cannot seem to find a couple of the nodes. Is it because I am in an old version? Also, I am not sure how to program the color code block. can someone explain this part to me better.
Nodes I am missing:
List Chop By Lengths
Family Types
Levels
Family Instance By Point and Level
Element Set Paramenters By Name
Material By Name
Thank you in advance !
Hello and welcome to the forum I can find List Chop By Lengths in Ampersand but Family Types, Levels, Family Instance By Point and Level, Element Set Parameters By Name and Material By Name are OOTB in Dynamo 1.2.1.3083.
This thread is already really long and for further issues, I would suggest to consider to start a new one with a specific title, referring to this one if necessary…