Randomise grids on curtain wall from list of spacing values

you don’t have the loop while node setup quite right. I would use a custom node for your loopbody - at least for me it is simpler to think about.

init is some value, so that looks fine, your condition looks okay, you’re going to quit when your sum of values != 1 in that list.

then your function adds a random value to that list, but it will always be the same random value as that part of your graph is not inside your function to be executed repeatedly.

Hi @arshamm,

If you are interested I showed another method to make random curtain walls at AU2017.

The video is here and the curtain wall portion is 47 minutes into the third video.

-john

1 Like

thanks for sharing the video, but yours is changing the panel’s type.
what i want to do is to randomize the distance between mullions or the width of the panels.

Whoops! Forgot what I showed there. :blush: Let me upload a new example tomorrow morning for you. :slight_smile:

2 Likes

When I do stuff like this I like to take the removal route rather than the addition route.

I start out with a curtain wall with minimum grid defined in the type properties. (in this example a 4x4)

then we remove the gridlines that we do not want, (undo to try another option) GIF below

and here is the graph image / dyn


randomCurtainGrid.dyn (14.0 KB)

Also, here is an app that does something similar if you were interested… https://apps.autodesk.com/RVT/en/Detail/Index?id=3268660468620377253&appLang=en&os=Win64

3 Likes

thank you John, this is a great way to randomize it.
but in my case the manufacturer gave me 4 sizes for panels, 450mm, 850mm, 1250mm and 1650mm, i want dynamo to divide the length of the curtain wall into these measurements and place a vertical grid randomly, the horizontal grid is fixed as we need only 400mm for dust space. something like this that I’ve been doing manually;
do you think if it’s possible?

There might be a more elegant solution than this but it seems to do the trick…

Python script:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

import sys
#The inputs to this node will be stored as a list in the IN variables.
pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib'
sys.path.append(pyt_path)
import random

#The inputs to this node will be stored as a list in the IN variables.
vals = IN[0]
length = IN[1]
refresh = IN[2]

def addVals(nums,total):
	sum = 0
	vals = []
	i = 0
	while sum<=total:
		i = random.choice(nums)
		vals.append(i)
		sum+=i
	return vals

OUT = addVals(vals,length)

Code Block:

vals = DSCore.List.RemoveItemAtIndex(list, (Count(list)-1));
amount = DSCore.List.Count(vals);
seq = 1..#amount..1;
spaces = Math.Sum(DSCore.List.TakeItems(vals,seq));
params = spaces/length;
points = (curtWall.GetLocation()).PointAtParameter(params);

EDIT to add, I’d freeze the CurtainGrid.AddGridLineByPoint node and run a few times refreshing, until I see a combination of points I like. And follow this suggestion from the post you linked above:

6 Likes

I added a bit to visualize the panels to better find a preferable confugration before running the graph (with the CurtainGrid.AddGridLineByPoint node unfrozen):



Add Curtain Grids at Random Vals from List.dyn (18.3 KB)

Hope this works for you :slight_smile: I’m thinking there could be a more effective/concise solution than this, so maybe someone else might share some ideas

8 Likes

you are the best! thank you Amy…

1 Like

Thanks a lot for your script.
How about controling horizontal grids? I’ve already tried “unconnected height” and tick true for “isUGridline” but it seem not working…

@NguyenTriTrung you’d have to adjust the code block where it says:

points = (curtWall.GetLocation()).PointAtParameter(params);

This part is creating points along the location line where grids will be placed. I can’t test at the moment but try modifying that line of the code block to get the start point of the curtain wall location line, and then translating another point in the z direction by the unconnected height parameter value. Then create a line using those two points as the start and end point, and from that line get the grid location points with PointAtParameter(params)

Let me know if you need clarification

2 Likes

I’ve already tried your code either but it still not working. I always get problems with “Unconnected Height” parameter when I want to get the element’s height. In the code block, I saw “params = spaces/length;”. Does it affect the result also?

Please help me clarify whenever you have time. Thanks a lot for your enthusiastic.

@NguyenTriTrung The params = spaces/length should still work with a height value, but if I am understanding correctly it sounds as though you are having trouble getting the height. Perhaps you should create a new topic and upload images with where it is failing, and the error you are getting.

1 Like

This is the topic i’ve just created. Please notice if u have any interest. Thank you :smiley:
Randomise horizontal grids on curtain wall - Getting height value

how do i get this to apply to my revit curtain wall? (delete the curtain grid portions) i am very green to dynamo. i see the preview in dynamo but, nothing gets selected in revit… apologies up front if this is a silly question…

1 Like

I also have a set pattern for the vertical grids and I’ve been able to get it to work. The cycle just repeats.
For the horizontal grids however, I am tasked with setting them with random sizes. The panel is 1250 mm so the architect decided to divide them into 1/1, 1/2, 1/3, and 2/3 panel sizes. The order is then randomized between each vertical grid.

With list.shuffle and list.cycle I’ve managed to get a long list of all of those panel lengths. But how can I make sure it only gets put up between the right grids to create segments?

(Btw, the removal route seems great, but the problem is that I also have 1/2 size and not just thirds.)

@awilliams,

All steps appear to work fine except for last command.
Any chance you can please help with this error?

*“Warning: CurtainGrid.AddGridLineByPoint operation failed.”

Dynamo Error

Thanks!

Yeah there is a bug in this node. Try and re-select the wall every time you run the script. Or use Dynamo Player

Please report here if that is the case: Issues · johnpierson/RhythmForDynamo · GitHub

Also, I think it is messing up because either:

  1. the point is not on the curtain grid “surface”
  2. A point exists in that location.

But if you add an issue there, I can take a look (sample files are great too)

Hey I just looked at the script again and I can’t recreate the error. At least not in a way that isn’t caused by the two parameters you noted.
I got the error because I used List.Cycle with a randomizer. That list exceeded the total length. the node did it’s work up until the nulls caused by the last two points (that exceeded)

1 Like