Grid intersection with family


Hi all,

I am trying to create a script that allows me to get location of family wrt nearest gridlines.
The error i got was number of items did not match number of keys. (In the test case below, the number of family instances and grid intersections are 5 and 4 respectively)

Below is a snapshot of the script.

Any help will be appreciated ! thanks! :slight_smile:


@JHJHJHJH You could quite easily ensure that the list lengths match


Hey @Vikram_Subbaiah !
That worked well for a awhile! ā€¦ Until I added more random grids. :sweat_smile:

Below are the attached files Iā€™m using, any idea what could have caused the error?

FamilyNearestGridLocation.dyn (24.2 KB)
Grid_intersect_test.rvt (1.7 MB)



If you need the location of each family according to the nearest gridlines why bother finding the intersection of the gridlines?
You can measure the distance from the location of each family instance to each gridline in the 2 groups then just pick the nearest of each group.


This is what I meant :

FamilyNearestGridLocation.dyn (24.4 KB)


@viktor_kuzev RIGHT! Now that you pointed that out, thats so much more efficient!
Thanks alot for your help viktor! :slight_smile: