I want to have the names of the closest intersection of the grids at both ends of the wall in two parameters, but I’m stuck with my script.
I can find X and Y coordinates of a certain type of wall, I can find X and Y coordinates of the grids, but does anyone know how to link both?
You need to apply some ‘computational thinking’. For example, (assuming the grids are not rotated from world XY) you could:
Extract the X and Y coordinate (start, mid, end it doesn’t really matter) of each grid Line as ordered lists where the indexes map to A, B, C respectively and the names of the grids themselves
Create start and end points on the wall curves and project them to the nearest grid in both X and Y dimensions (Geometry.DistanceTo or Geometry.ClosestPointTo are possible options)
Use the resultant X and Y of the projected start/end points as keys to access the relative index from the grid list created in step 1 to return its name
Write this data to your wall parameter
If you know how to code this problem is far more easier to solve than you might think. Using visual programming is going to be pretty cumbersome for what is largely a relatively straightforward problem.
The png should be clear enough (if you open it in a new window or download it). If you have the patience to rebuild it, I’ll be glad to answer to any question.
String.Contains and Clear List are from Archi-lab Grimshaw, Geometry Intersection is from Dynamo4MEP, All Elements of Family Type (Universal) is from Clockwork and finally, Springs.Dictionary.ByKeysValues is from Spring Nodes.
Hi @Yna_Db,
I used your script as a base for my final result. The biggest advantage of your script is that it was possible to find the closest intersection point of a grid independent of the oriëntation of the wall.
Because in my project I had to have different result for walls with x-direction and y-direction I had to add more nodes, but I got it working. Thanks for your help!