Family Types Node - cannot find family in the dropdown list, it exists in the model Dynamo is running and also in the Project Browser

Hello everyone, i am new to Dynamo, and i ran into this problem that is sucking the life out of me for the past couple of days:

I am trying to get the start and end Points’ coordinates for some cable trays using the .dyn file in the attached picture. (i cropped multiple pictures into 1 cause i can only attach 1 pic)

If i use Element.GetLocation i get a line, of which points’ i can clearly see in the list - start & end point, together with their coordinates but i can’t extract the points from the line, not with Dynamo’s proprietary Nodes.
(i want to avoid using custom libraries, i heard if Dynamo updates those libraries are not guaranteed to be updated by the nice people who create them)

Q1. If you use a custome node in Python, does that one break too if Dynamo updates?

So i read somewhere that using Family Instance Get Location i will get the 2 separate points - start and end. EASY, right? WRONG! :smiley:

THE PROBLEM is that the target family’s name does not show in the drop down list of the Family Types node! Not even something generic like “cable trays” is showing there, how is this possible?

So i found online a workaround, first line of nodes in the picture. Which behaves really strange, it first extracts the name of the Family Types in the Cable Tray category but then when it tries to get the Family Type by the same name it says the name is not found!
Is it something i am missing? Am i so fixated on the issue that i cannot see the forest for the trees?

Picture explained even if it may be obvious

  • top part is the actual model Dynamo is running on,you can see the tray, type name, family in Project Browser
  • middle part the 2 unsuccessful Dynamo approaches
  • bottom part - Element.Location lines list with points in () which i don’t know how to extract…and Select all by category working just fine for Trays

A few remarks:
MagiCAD may have been used to create those Trays but…does that matter?

my soul will torment until i get this to work and i will not shut an eye.
*just kidding, but at this point I am both a bit mad and disappointed by myself.

Depends on the update, and the python node.

Depends on what MagiCAD is and how it did whatever it did.

After all elements of category (#3 in your image), why not group the family instances (which were collected by the all elements of node) by the family name, and them create a dictionary of the groups and keys, followed by a Dictionary.ValueAtKey node to pull the relevant family instances, and then get the location?

I believe that cable trays are system families like walls, floors, and the like. As such they will not show up in the family types node - that is for loadable families.

Hello and thank you so much for the replay.
Either i am not doing it right or it is not working, i get elements, which are different than Family Instances (right?), so i cannot get the Family Instance Location with elements input.

I found a way online that extracts all family instances but surprise-surprise the trays are not there…
So it looks like it is as you said in the bottom paragraph of the quote.
It is really weird that those system families are …so hard to get?

Still, I found the solution to my OTHER problem - getting the Start and End Points from a Line - Element Get Location gives as i said Lines. To extract Start and End Points of said lines i used the Curves method - Start and End Point :slight_smile: quite ludacris if you ask me that i did not think of looking in the Curves methods but better late than never.

See attached merged pics with:

  • top part Solution
  • bottom trying as you said?

I was referring to the all elements of category effort in your image, not the element types effort.

  1. All elements of Category “Cable Tray”

  2. FamilyType.Name

  3. List.Group By Key where the all elements of category is the list, and the names are the key

  4. Dictionary.ByKeysValues where the groups are the values, and the keys are the unique keys (both from the group by key node).

  5. Dictionary.ValueAtKey where the key is the name of the cable try family you want to work with and the dictionary is the recently created dictionary.

  6. Element.GetLocation to get the location of the trays.

  7. Curve.PointAtParameter where the location curves are the curves, and the Parameter is [0,1]. Set the curves input to @L1 to ensure you iterate over the list of curves correctly.

Hello @bogdan.petrescu63URX

if you want to get Family Name of cable trays here are 2 solutions

import clr
import sys
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument

toList = lambda x : x if hasattr(x, '__iter__') else [x]
elems = toList(UnwrapElement(IN[0]))

OUT = [doc.GetElement(x.GetTypeId()).FamilyName for x in elems ]

I am overwhelmed by you guys, @jacob.small and @c.poupin , these are worth studying!

Thank you!