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

Can you please help me with this one? I’m lost at lists.

Hey Dynamos,

i wanted to modify this script a bit but its a long time since i did something with dynamo :frowning: . 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.

But i don’t know how to geht only the elements in the list.


It says i cant use string and need elements.

Any idea?

You are passing the Element.Name to the FilterByBoolMask and not the grids

Ok i don’t get it :frowning:

So the first script is:

  • Get all Grids and all Doors
  • cross poduct wiht geometry.distanceTo

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 :rofl: :roll_eyes:

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.