Position of a door

Hi all,

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.

Any clue?

schlueter

Try Geometry.ClosestPointTo

Thanks.

Ok i found the node i was looking for in another door thread. I came up with somekind of this in my mind. But of course its not working. I’m not pro :confused:

Then i tried your node and came up with this. But its not working either. It says: position failed…gridlines are no curves

Could use help :smiley: Any other tips?

You’ll need to extract the curve of the grid line in a similar way you got the point of the door.

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.

Hi Mostafa,

thans for your reply. I tried what you have said. Thats what i came up with so far.


I tried it with List.FirstItem and List.MinimumItem. No result with First and some result with minimum. I found this similar thread about Linear Revit Elements - Report distance to nearest parallel grid. But this makes it not easier for me :confused:

This is my testproject.

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.

door-grid.dyn (11.9 KB)

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.

1 Like

try this :

2 Likes

As David_Wood3 said the lacing should be set to cross product:

2 Likes

Thanks to all.

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?

Thanks

Hi, you could be interested in this page:
http://dynamoprimer.com/en/06_Designing-with-Lists/6-3_lists-of-lists.html
(see List@Level)

1 Like