i was just thinking if it is possibil to track the nearest gridline (floorplan) of a door and then write that name of the gridline in a parameter?
I think i’v read some when i was looking for roomnames in the doorschedules. thought there was some kind of “nearest” node. But not sure and i can’t find it.
Ok i found grid.curve. Now i get the points of the grid line and no failor in the element.getLocation. But it just shows the location (cords) of the door.
is my way of thinking correct or am i doing it all wrong?
Hi @schlueter ,
I think you should swap the inputs of Geometry.ClosestPointTo and set it’s lacing to longest.
But actually, I think it would be better to use DistanceTo node (in the exact same way, same inputs and lacing…) , then use SortIndexByValue node on the DistanceTo output. Finally, you’ll be able to use the first item of SortIndexByValue to get the closest grid in the grid list with List.GetItemAtIndex.
Now it actully does something but not right :D. In the first tow doors it set the parametername but used the first grid and then the second. I think it has nothing to do with the distence right now. The other doors did not get any parameter value.
So you are trying to find the closest grid (from a list of grids) to each door in a list of doors.
So your Geometry.DistanceTo node needs to be set Lacing = Cross Product. That way, you will get a nested list containing the shortest distance from every door to every grid. Then, for each door, you can find which grid is closest.
Edit - Now I see Mostafa’s use of List@Level (below), I think that is more elegant than using Cross Product.
Its woking party. I love this tool. Thanks again for all u’r replies and help. I just got the nearest grid for hundrets of doors in one click. Saved alot of work for my door schedules.
@viktor_kuzev
I get it with the cross product like @David_Wood3 said but what i don’t understand is your change at the “List.FirstItem” node. The german translation is not very helpfull.
Can you explain to me what this does or do you have any help article?
i wanted to modify this script a bit but its a long time since i did something with dynamo . So i hope i can get a little help with my idea.
Idea:
Get nearest Grid with Letters “A”…“Z”; and nearest Grid with Numbers 1…99;. These tow results should show up in the comment parameter like “A,2”.
First i tought of making tow lists. One for A-Z and one for the Numbers.
So i get a list for every door and what distance every grid has to this door. Then:
List.SortIndexByVaue so the nearest ist on top
list.firstItem to get the nearest grid
so on…
But i think after the corss product of Geometry.distanceTo its to late for the boolmask. isn’t it? I thougt i need to separate the Grids first.
Ok while i was writing i tried something different. After List.SortIndexbyvalue i deleted list.firstItem. So now i get a List of all Grids sorted by the distance. I’m thinking of separating the list via boolmask to only list numbers and a second list wiht only letters.After that i would take the firstItem of both lists.
But i’m doing it wrong because i can’t get the bool maks to work.
This is the script atm.
Can’t Upload images Oo so i tried it with imgur.
Ok so i don’t realy understand what i’m doing and i need to do reengenierung on other case and scripts and do some kind of trail and error
I think the list.contains is not nessescery. But the String.contains its just checking if in list 1 ther is an A and in list 2 there is an B. I want that its checking every letter in every list.
The graph above is ~3 years old, but the original messages date back to 2017(!) and as such many of the people here aren’t active. I can confirm from experience that the thread has multiple working solutions posted in the images - you just need to rebuild them. I am closing the thread for now to prevent the noise of such old stuff from polluting the board.
Build one of the images out and if it doesn’t work start a new topic. You may want to run through the primer as well as it will teach you the basics before you have to apply concepts like lacing and list levels (which are required in this use).